gcc/testsuite/g++.dg/ext/attrib49.C
raw| 1 | // PR c++/60765 |
| 2 | // { dg-options "-Wall -Wunused-parameter" } |
| 3 | |
| 4 | struct foo |
| 5 | { |
| 6 | } x; |
| 7 | |
| 8 | void (foo::*g) (int *) __attribute__ ((nonnull (2))); |
| 9 | |
| 10 | void |
| 11 | fun1 (void (foo::*f) (int *) __attribute__ ((nonnull (2)))) |
| 12 | { |
| 13 | (x.*f) ((int *) 0); // { dg-warning "argument 1 null" } |
| 14 | } |
| 15 | |
| 16 | void |
| 17 | fun2 (void (foo::*f) () __attribute__ ((nonnull, unused))) // { dg-bogus "unused" } |
| 18 | { |
| 19 | (x.*g) ((int *) 0); // { dg-warning "argument 1 null" } |
| 20 | } |