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.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 09a0385..0577c76 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -5310,12 +5310,8 @@ finish_struct (t, attributes)
else
error ("trying to finish struct, but kicked out due to previous parse errors");
- if (processing_template_decl)
- {
- tree scope = current_scope ();
- if (scope && TREE_CODE (scope) == FUNCTION_DECL)
- add_stmt (build_min (TAG_DEFN, t));
- }
+ if (processing_template_decl && at_function_scope_p ())
+ add_stmt (build_min (TAG_DEFN, t));
return t;
}