2017-06-28 Jason Merrill <jason@redhat.com>
+ PR c++/69300 - ICE with self-referential noexcept
+ * pt.c (maybe_instantiate_noexcept): Check for recursion.
+
PR c++/61022 - error with variadic template template parm
* pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
if (TREE_CODE (noex) == DEFERRED_NOEXCEPT)
{
+ static hash_set<tree>* fns = new hash_set<tree>;
+ bool added = false;
if (DEFERRED_NOEXCEPT_PATTERN (noex) == NULL_TREE)
spec = get_defaulted_eh_spec (fn);
+ else if (!(added = !fns->add (fn)))
+ {
+ /* If hash_set::add returns true, the element was already there. */
+ location_t loc = EXPR_LOC_OR_LOC (DEFERRED_NOEXCEPT_PATTERN (noex),
+ DECL_SOURCE_LOCATION (fn));
+ error_at (loc,
+ "exception specification of %qD depends on itself",
+ fn);
+ spec = noexcept_false_spec;
+ }
else if (push_tinst_level (fn))
{
push_access_scope (fn);
else
spec = noexcept_false_spec;
+ if (added)
+ fns->remove (fn);
+
TREE_TYPE (fn) = build_exception_variant (fntype, spec);
}