gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C
raw| 1 | // PR c++/36870 |
| 2 | // { dg-do run } |
| 3 | // { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } } |
| 4 | #include <cassert> |
| 5 | |
| 6 | struct S { S (); }; |
| 7 | |
| 8 | bool f (); |
| 9 | |
| 10 | int main () |
| 11 | { |
| 12 | assert (__has_nothrow_constructor (S) == f ()); |
| 13 | } |
| 14 | |
| 15 | S::S () { } |
| 16 | |
| 17 | bool f () { return __has_nothrow_constructor (S); } |