gcc/testsuite/g++.dg/warn/Wnonnull16.C
raw| 1 | // PR c++/115580 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | class WithMember { |
| 5 | public: |
| 6 | int foo(); |
| 7 | }; |
| 8 | |
| 9 | decltype(((WithMember*)nullptr)->foo()) footype; // { dg-bogus "pointer is null" } |
| 10 | |
| 11 | int f(void*) __attribute__((nonnull)); |
| 12 | |
| 13 | void g() |
| 14 | { |
| 15 | [[maybe_unused]] decltype(f(nullptr)) b; // { dg-bogus "non-null" } |
| 16 | } |