aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-06-24 19:18:43 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-06-24 19:18:43 +0000
commit5f261ba970a894543b1c8c30f71c7eb2a234ba93 (patch)
treebe46d82b47945fa6f5b787b66f752af4d7711a6b /gcc/cp/class.c
parent87912be720118115eded3786b807a34cfb0f0a81 (diff)
downloadgcc-5f261ba970a894543b1c8c30f71c7eb2a234ba93.zip
gcc-5f261ba970a894543b1c8c30f71c7eb2a234ba93.tar.gz
gcc-5f261ba970a894543b1c8c30f71c7eb2a234ba93.tar.bz2
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 <ttype>. 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
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;
}