From c6ecc13a07cae1131fdbb91e465269402e4b0323 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 21 Mar 2019 01:03:30 +0000 Subject: [PATCH] re PR c++/89571 (ICE in nothrow_spec_p, at cp/except.c:1238) /cp 2019-03-21 Paolo Carlini 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 PR c++/89571 * g++.dg/cpp0x/noexcept37.C: New. From-SVN: r269832 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/method.c | 3 +++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/noexcept37.C | 8 ++++++++ 4 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept37.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 09fb3f2935c..5a28c96d52a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-03-21 Paolo Carlini + + PR c++/89571 + * method.c (after_nsdmi_defaulted_late_checks): Avoid passing + error_mark_node to comp_except_specs. + 2019-03-20 Jason Merrill PR c++/87480 - decltype of member access in default template arg diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 477d3271f59..da9600cd143 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7487e91a954..12fdbd0bf90 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-21 Paolo Carlini + + PR c++/89571 + * g++.dg/cpp0x/noexcept37.C: New. + 2019-03-21 Iain Buclaw 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 index 00000000000..93dfecb9662 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept37.C @@ -0,0 +1,8 @@ +// PR c++/89571 +// { dg-do compile { target c++11 } } + +struct A +{ + int i = ; // { dg-error "expected" } + A() noexcept = default; +}; -- 2.30.2