1 // { dg-do compile { target c++11 } }
2 // { dg-options "-Wall -Wformat=2 -Wstrict-null-sentinel" }
4 // Test various warnings
6 void f1(const char*, ...) __attribute__((format(printf, 1, 2)));
7 void f2(const char*) __attribute__((nonnull));
8 void f3(const char*, ...) __attribute__((sentinel));
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;
18 f2(mynull); // { dg-warning "null argument where non-null required " }