gcc/testsuite/g++.dg/warn/Wnonnull8.C
raw| 1 | /* PR c++/96310 - Ignoring -Wnonnull via pragma gcc diagnostics still produces |
| 2 | an unwanted note |
| 3 | { dg-do compile } |
| 4 | { dg-options "-Wall" } */ |
| 5 | |
| 6 | struct C { |
| 7 | void f (); // { dg-message "in a call" } |
| 8 | void g (); // { dg-bogus "in a call" } |
| 9 | }; |
| 10 | |
| 11 | void f () |
| 12 | { |
| 13 | static_cast<C*>(0)->f (); // { dg-warning "\\\[-Wnonnull" } |
| 14 | } |
| 15 | |
| 16 | void g () |
| 17 | { |
| 18 | #pragma GCC diagnostic ignored "-Wnonnull" |
| 19 | static_cast<C*>(0)->g (); |
| 20 | } |