re PR c++/63194 (ICE in maybe_explain_implicit_delete, at cp/method.c:1552)
authorJason Merrill <jason@redhat.com>
Sat, 11 Oct 2014 02:26:33 +0000 (22:26 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 11 Oct 2014 02:26:33 +0000 (22:26 -0400)
PR c++/63194
* method.c (defaulted_late_check): Call maybe_instantiate_noexcept.

From-SVN: r216114

gcc/cp/ChangeLog
gcc/cp/method.c
gcc/testsuite/g++.dg/cpp0x/noexcept25.C [new file with mode: 0644]

index 3e2ab6ece4278805a0c821a784d11e08202ac303..acdb354816c39476c97721f5193e51a073f2efb5 100644 (file)
@@ -1,5 +1,8 @@
 2014-10-10  Jason Merrill  <jason@redhat.com>
 
+       PR c++/63194
+       * method.c (defaulted_late_check): Call maybe_instantiate_noexcept.
+
        * method.c (implicitly_declare_fn): Handle deleted lambda default
        ctor and copy assop here.
        * class.c (check_bases_and_members): Not here.
index dce2d2b2caf754f9aea7342b278bb8b3eec4988d..418ed8874d09d0f76f3659b828f5b2dd86630a16 100644 (file)
@@ -1979,6 +1979,7 @@ defaulted_late_check (tree fn)
      is explicitly defaulted on its first declaration, (...) it is
      implicitly considered to have the same exception-specification as if
      it had been implicitly declared.  */
+  maybe_instantiate_noexcept (fn);
   tree fn_spec = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn));
   if (!fn_spec)
     {
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept25.C b/gcc/testsuite/g++.dg/cpp0x/noexcept25.C
new file mode 100644 (file)
index 0000000..e79b786
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/63194
+// { dg-do compile { target c++11 } }
+
+template <int>
+class A {
+ public:
+  A() noexcept(noexcept(0)) = default;
+};
+class B {
+  A<0> m_points;
+};
+void fn1(A<0>, A<0>) { B(); }