]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/56268 (C++11 ICE with boost multi-precision and boost variant during assign...
authorJason Merrill <jason@redhat.com>
Mon, 11 Feb 2013 16:21:10 +0000 (11:21 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 11 Feb 2013 16:21:10 +0000 (11:21 -0500)
PR c++/56268
* semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
maybe_instantiate_noexcept.

From-SVN: r195945

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/g++.dg/ext/has_nothrow_copy-8.C [new file with mode: 0644]

index 3bf2df6ad141cc53597237019d5eee672a8c6ed9..a9288cd6981a61b8557ad2c820d0a4d5da816671 100644 (file)
@@ -1,3 +1,9 @@
+2013-02-11  Jason Merrill  <jason@redhat.com>
+
+       PR c++/56268
+       * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
+       maybe_instantiate_noexcept.
+
 2013-02-09  Jason Merrill  <jason@redhat.com>
 
        PR c++/56247
index d39d50a5f443c43cce6cdcdbb586ead0535e4d84..bde24d34ca1b046b545c058ec398d46c2b247df7 100644 (file)
@@ -5351,6 +5351,7 @@ classtype_has_nothrow_assign_or_copy_p (tree type, bool assign_p)
       else if (copy_fn_p (fn) <= 0)
        continue;
 
+      maybe_instantiate_noexcept (fn);
       if (!TYPE_NOTHROW_P (TREE_TYPE (fn)))
        return false;
     }
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-8.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-8.C
new file mode 100644 (file)
index 0000000..e1be1a0
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/56268
+// { dg-options -std=c++11 }
+
+template <class T>
+struct A {
+  A(const A&) noexcept (T::value);
+};
+
+struct B {
+  static const bool value = true;
+};
+
+template <class T>
+struct C {
+  static const bool value = __has_nothrow_copy (T);
+};
+
+#define SA(X) static_assert((X),#X)
+SA(C<A<B>>::value);