]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/warn/Wnonnull3.C
Underline argument in -Wnonnull and in C++ extend warning to the this pointer [PR...
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / warn / Wnonnull3.C
CommitLineData
822a132c
MP
1// PR c++/79962
2// { dg-options "-Wnonnull" }
3
4template <class T>
5__attribute__ ((__nonnull__ (T::i))) void f (typename T::U) { }
6
7struct S1 { enum { i = 1 }; typedef void* U; };
8struct S2 { static const int i = 1; typedef void* U; };
9
10void
11g ()
12{
75ff24e1
MS
13 f<S1>(0); // { dg-warning "argument 1 null where non-null expected" }
14 f<S2>(0); // { dg-warning "argument 1 null where non-null expected" }
822a132c 15}