aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f44acfd..830ede5 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -7246,6 +7246,7 @@ finish_struct (tree t, tree attributes)
error ("trying to finish struct, but kicked out due to previous parse errors");
if (processing_template_decl && at_function_scope_p ()
+ && TYPE_CONTEXT (t) == current_function_decl
/* Lambdas are defined by the LAMBDA_EXPR. */
&& !LAMBDA_TYPE_P (t))
add_stmt (build_min (TAG_DEFN, t));