re PR c++/89571 (ICE in nothrow_spec_p, at cp/except.c:1238)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 21 Mar 2019 01:03:30 +0000 (01:03 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 21 Mar 2019 01:03:30 +0000 (01:03 +0000)
/cp
2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/89571
* method.c (after_nsdmi_defaulted_late_checks): Avoid passing
error_mark_node to comp_except_specs.

/testsuite
2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/89571
* g++.dg/cpp0x/noexcept37.C: New.

From-SVN: r269832

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

index 09fb3f2935c333a8e19493f405f0e79705b9d41f..5a28c96d52a926ed177d99aeae7e9bc096f05173 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/89571
+       * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
+       error_mark_node to comp_except_specs.
+
 2019-03-20  Jason Merrill  <jason@redhat.com>
 
        PR c++/87480 - decltype of member access in default template arg
index 477d3271f59709ab01f6b643cc92bc80eee865bb..da9600cd14326e5c3e69a5d689338d9a1c84f258 100644 (file)
@@ -2274,6 +2274,9 @@ after_nsdmi_defaulted_late_checks (tree t)
          continue;
 
        tree eh_spec = get_defaulted_eh_spec (fn);
+       if (eh_spec == error_mark_node)
+         continue;
+
        if (!comp_except_specs (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)),
                                eh_spec, ce_normal))
          DECL_DELETED_FN (fn) = true;
index 7487e91a95485cb13848cf83f490cb70988f4ed2..12fdbd0bf90b0d4a9bda550624bad73c7670d6f1 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/89571
+       * g++.dg/cpp0x/noexcept37.C: New.
+
 2019-03-21  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        PR d/89017
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept37.C b/gcc/testsuite/g++.dg/cpp0x/noexcept37.C
new file mode 100644 (file)
index 0000000..93dfecb
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/89571
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+  int i = ;  // { dg-error "expected" }
+  A() noexcept = default;
+};