summaryrefslogtreecommitdiff
path: root/gcc/cp/except.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/except.c')
-rw-r--r--gcc/cp/except.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 669bf9f6eaf..0b46698b974 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -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);
}
}