]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/ext/attrib49.C
Underline argument in -Wnonnull and in C++ extend warning to the this pointer [PR...
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / ext / attrib49.C
CommitLineData
1dbdb756
PP
1// PR c++/60765
2// { dg-options "-Wall -Wunused-parameter" }
3
4struct foo
5{
6} x;
7
8void (foo::*g) (int *) __attribute__ ((nonnull (2)));
9
10void
11fun1 (void (foo::*f) (int *) __attribute__ ((nonnull (2))))
12{
75ff24e1 13 (x.*f) ((int *) 0); // { dg-warning "argument 1 null" }
1dbdb756
PP
14}
15
16void
17fun2 (void (foo::*f) () __attribute__ ((nonnull, unused))) // { dg-bogus "unused" }
18{
75ff24e1 19 (x.*g) ((int *) 0); // { dg-warning "argument 1 null" }
1dbdb756 20}