OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [nullptr22.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-std=c++0x -Wall -Wformat=2 -Wstrict-null-sentinel" }
3
 
4
// Test various warnings
5
 
6
void f1(const char*, ...) __attribute__((format(printf, 1, 2)));
7
void f2(const char*) __attribute__((nonnull));
8
void f3(const char*, ...) __attribute__((sentinel));
9
 
10
void f()
11
{
12
  f1("%p", nullptr);
13
  f2(nullptr); // { dg-warning "null argument where non-null required " }
14
  f3("x", "y", __null); // { dg-warning "missing sentinel in function call" }
15
  f3("x", "y", nullptr);
16
  decltype(nullptr) mynull = 0;
17
  f1("%p", mynull);
18
  f2(mynull); // { dg-warning "null argument where non-null required " }
19
  f3("x", "y", mynull);
20
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.