This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH for c++/63194 (ICE with defaulted function with explicit noexcept)


Missed a spot where we need to force noexcept instantiation.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit f8cffba287011ed170e8369372f7867293b19e4a
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Oct 10 17:26:59 2014 -0400

    	PR c++/63194
    	* method.c (defaulted_late_check): Call maybe_instantiate_noexcept.

diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index dce2d2b..418ed88 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -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
index 0000000..e79b786
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept25.C
@@ -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(); }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]