Commit dd39c7d1 by Jason Merrill Committed by Jason Merrill

PR c++/84045 - ICE with typedef and noexcept.

	* except.c (build_noexcept_spec): Use strip_typedefs_expr.

From-SVN: r257713
parent f3ad8745
2018-02-15 Jason Merrill <jason@redhat.com>
PR c++/84045 - ICE with typedef and noexcept.
* except.c (build_noexcept_spec): Use strip_typedefs_expr.
PR c++/84376 - ICE with omitted template arguments.
* pt.c (dguide_name_p): Check for IDENTIFIER_NODE.
......
......@@ -1217,6 +1217,10 @@ build_noexcept_spec (tree expr, int complain)
{
gcc_assert (processing_template_decl
|| TREE_CODE (expr) == DEFERRED_NOEXCEPT);
if (TREE_CODE (expr) != DEFERRED_NOEXCEPT)
/* Avoid problems with a function type built with a dependent typedef
being reused in another scope (c++/84045). */
expr = strip_typedefs_expr (expr);
return build_tree_list (expr, NULL_TREE);
}
}
......
// PR c++/84045
// { dg-do compile { target c++11 } }
template <typename T> struct K {
static const bool d = true;
};
template <typename T, typename> struct B {
typedef K<T> D;
void foo () noexcept (D::d);
};
template <typename T> struct P {
P () noexcept (K<T>::d);
};
P<int> p;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment