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