diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C')
-rw-r--r-- | gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C new file mode 100644 index 000000000..573fd2f80 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C @@ -0,0 +1,16 @@ +// PR c++/36870 +// { dg-do run } +#include <cassert> + +struct S { S (const S&); }; + +bool f (); + +int main () +{ + assert (__has_nothrow_copy (S) == f ()); +} + +S::S (const S&) { } + +bool f () { return __has_nothrow_copy (S); } |