gcc/testsuite/g++.dg/ext/attr-no-dangling4.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | |
| 3 | #if !__has_attribute(no_dangling) |
| 4 | #error unsupported |
| 5 | #endif |
| 6 | |
| 7 | #ifdef __has_cpp_attribute |
| 8 | # if !__has_cpp_attribute(no_dangling) |
| 9 | # error no_dangling |
| 10 | # endif |
| 11 | #endif |
| 12 | |
| 13 | struct [[gnu::no_dangling]] S { }; |
| 14 | static_assert (__builtin_has_attribute (S, no_dangling), ""); |