* except.c (build_noexcept_spec): Use strip_typedefs_expr.
From-SVN: r257713
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.
{
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);
}
}
--- /dev/null
+// 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;