blob: e5b5329ffca910272673100384be0413945c5107 [file] [log] [blame]
Chandler Carruth07d7e7a2010-11-16 08:35:43 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2struct S {
3 static void f(const char*, const char*) __attribute__((nonnull(1)));
4
5 // GCC has a hidden 'this' argument in member functions, so the middle
6 // argument is the one that must not be null.
7 void g(const char*, const char*, const char*) __attribute__((nonnull(3)));
8
9 void h(const char*) __attribute__((nonnull(1))); // \
10 expected-error{{invalid for the implicit this argument}}
11};
12
13void test(S s) {
14 s.f(0, ""); // expected-warning{{null passed}}
15 s.f("", 0);
16 s.g("", 0, ""); // expected-warning{{null passed}}
17 s.g(0, "", 0);
18}