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