From 5f261ba970a894543b1c8c30f71c7eb2a234ba93 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 24 Jun 2002 19:18:43 +0000 Subject: cp-tree.h (SCALAR_TYPE_P): New macro. * cp-tree.h (SCALAR_TYPE_P): New macro. (check_for_out_of_scope_variable): New function. (at_class_scope_p): Likewise. (finish_fname): Likewise. * class.c (finish_struct): Use at_function_scope_p. * decl.c (check_for_out_of_scope_variable): New function, split out from do_identifier. (finish_enum): Use at_function_scope_p. * lex.c (do_identifier): Use check_for_out_of_scope_variable. * parse.y (VAR_FUNC_NAME): Give it . Use finish_fname. (primary): Use at_function_scope_p. * search.c (at_class_scope_p): New function. * semantics.c (finish_fname): Likewise. (check_multiple_declarators): Use at_function_scope_p. From-SVN: r54962 --- gcc/cp/class.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gcc/cp/class.c') 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; } -- cgit v1.1