Hi Jason ---
On 17/03/19 21:06, Jason Merrill wrote:
Earlier changes to defer instantiating a defaulted noexcept-specifier that
depends on yet-unparsed default member initializers broke this testcase,
where instantiation fails for another reason. In this case there's no
reason to defer and try again later, so let's not.
[snip]
Thanks.
Volker added to the audit trail the below, vaguely related, testcase,
also a recent error recovery regression. Shall we just avoid passing
error_mark_node to comp_except_specs and continue? Tested x86_64-linux.
Thanks again, Paolo.
////////////////////
/cp
2019-03-20 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/89571
* method.c (after_nsdmi_defaulted_late_checks): Avoid passing
error_mark_node to comp_except_specs.
/testsuite
2019-03-20 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/89571
* g++.dg/cpp0x/noexcept37.C: New.
Index: cp/method.c
===================================================================
--- cp/method.c (revision 269825)
+++ cp/method.c (working copy)
@@ -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: testsuite/g++.dg/cpp0x/noexcept37.C
===================================================================
--- testsuite/g++.dg/cpp0x/noexcept37.C (nonexistent)
+++ testsuite/g++.dg/cpp0x/noexcept37.C (working copy)
@@ -0,0 +1,8 @@
+// PR c++/89571
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+ int i = ; // { dg-error "expected" }
+ A() noexcept = default;
+};