In a template we don't instantiate a deferred noexcept-spec, and we don't
need it because we aren't going to do anything with the value of
throwing_cleanup in a template anyway.
PR c++/93345 - ICE with defaulted dtor and template.
PR c++/33799
* decl.c (cxx_maybe_build_cleanup): Don't try to set
throwing_cleanup in a template.
+2020-01-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/93345 - ICE with defaulted dtor and template.
+ PR c++/33799
+ * decl.c (cxx_maybe_build_cleanup): Don't try to set
+ throwing_cleanup in a template.
+
2020-01-22 Marek Polacek <polacek@redhat.com>
PR c++/92907 - noexcept does not consider "const" in member functions.
&& !mark_used (decl, complain) && !(complain & tf_error))
return error_mark_node;
- if (cleanup && cfun && !expr_noexcept_p (cleanup, tf_none))
+ if (cleanup && cfun && !processing_template_decl
+ && !expr_noexcept_p (cleanup, tf_none))
cp_function_chain->throwing_cleanup = true;
return cleanup;
--- /dev/null
+// PR c++/93345
+// { dg-do compile { target c++11 } }
+
+struct ln {
+ ~ln ();
+};
+
+struct ry {
+ ln kj;
+};
+
+template<typename GC>
+void
+dz ()
+{
+ ry{};
+}