aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-09-15 00:59:28 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-09-15 00:59:28 +0000
commita7e8c268ed44dd8f09259ba8000be311af7562e7 (patch)
treef3051c561271e0d6315435584c95dbebfa9c2c8c /gcc/cp/cp-tree.h
parent29edb15c5637738f3ac9c9d63003303127848204 (diff)
downloadgcc-a7e8c268ed44dd8f09259ba8000be311af7562e7.zip
gcc-a7e8c268ed44dd8f09259ba8000be311af7562e7.tar.gz
gcc-a7e8c268ed44dd8f09259ba8000be311af7562e7.tar.bz2
re PR c++/3907 (nested template parm collides with member name)
* coverage.c (create_coverage): Do not call pushlevel/poplevel. * langhooks-def.h (lhd_do_nothing_iii_return_null_tree): New function. * langhooks.c (lhd_do_nothing_iii_return_null_tree): Define it. PR c++/3907 * class.c (maybe_note_name_used_in_class): Refine test for whether or not we are in a class scope. * cp-tree.h (language_function): Remove x_expanding_p. (expanding_p): Remove. (doing_semantic_analysis_p): Remove. (scope_kind): Add sk_function_parms, sk_class, sk_namespace. (innermost_scope_kind): New method. * call.c (cxx_type_promotes_to): Use type_decays_to. * cp-lang.c (LANG_HOOKS_PUSHLEVEL): Redefine. (LANG_HOOKS_POPLEVEL): Likewise. * decl.c (cp_binding_level): Remove parm_flag, template_parms_p, template_spec_p, namespace_p, is_for_scope, is_try_scope, and is_catch_scope. Add kind and explicit_spec_p. (cxx_scope_descriptor): Use a lookup table. (find_class_binding_level): Use "kind" field in binding_level, not the various flags. (pop_binding_level): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (template_parm_scope_p): Likewise. (innermost_scope_kind): New method. (current_tmpl_spec_kind): Use "kind" field in binding_level, not the various flags. (pushlevel): Remove check for doing_semantic_analysis_p. (begin_scope): Simplify. (add_decl_to_level): Use "kind" field in binding_level, not the various flags. (push_local_binding): Likewise. (pop_label): Remove check for doing_semantic_analysis_p. (poplevel): Use "kind" field in binding_level, not the various flags. (set_block): Remove check for doing_semantic_analysis_p. (pushlevel_class): Use "kind" field in binding_level, not the various flags. (poplevel_class): Likewise. (initial_push_namespace_scope): Likewise. (maybe_push_to_top_level): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (maybe_process_template_type_declaration): Likewise. (pushtag): Likewise. (pushdecl): Likewise. (pushdecl_with_scope): Likewise. (check_previous_goto_1): Likewise. (define_label): Likewise. (finish_case_label): Likewise. (lookup_tag): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_name_real): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (record_builtin_type): Likewise. (cp_make_fname_decl): Likewise. (maybe_inject_for_scope_var): Likewise. (cp_finish_decl): Remove check for doing_semantic_analysis_p. (start_function): Use begin_scope, not pushlevel. (finish_function): Use "kind" field in binding_level, not the various flags. (start_method): Use begin_scope, not pushlevel. (make_label_decl): Do not check expanding_p. (save_function-data): Do not set expanding_p. (cxx_push_function_context): Do not clear expanding_p. * semantics.c (cxx_expand_function_start): Do not set expanding_p. PR c++/3907 * g++.dg/parse/template12.C: New test. * g++.dg/abi/bitfield11.C: New test. * g++.dg/abi/bitfield12.C: Likewise. From-SVN: r71393
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 8ab8c6c..1d126e8 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -798,7 +798,6 @@ struct language_function GTY(())
int returns_abnormally;
int in_function_try_handler;
int in_base_initializer;
- int x_expanding_p;
/* True if this function can throw an exception. */
bool can_throw : 1;
@@ -860,17 +859,6 @@ struct language_function GTY(())
#define current_function_returns_abnormally \
cp_function_chain->returns_abnormally
-/* Nonzero if we should generate RTL for functions that we process.
- When this is zero, we just accumulate tree structure, without
- interacting with the back end. */
-
-#define expanding_p cp_function_chain->x_expanding_p
-
-/* Nonzero if we are in the semantic analysis phase for the current
- function. */
-
-#define doing_semantic_analysis_p() (!expanding_p)
-
/* Nonzero if we are processing a base initializer. Zero elsewhere. */
#define in_base_initializer cp_function_chain->in_base_initializer
@@ -2942,15 +2930,24 @@ typedef enum cp_lvalue_kind {
/* The kinds of scopes we recognize. */
typedef enum scope_kind {
- sk_block, /* An ordinary block scope. */
+ sk_block = 0, /* An ordinary block scope. This enumerator must
+ have the value zero because "cp_binding_level"
+ is initialized by using "memset" to set the
+ contents to zero, and the default scope kind
+ is "sk_block". */
sk_try, /* A try-block. */
sk_catch, /* A catch-block. */
sk_for, /* The scope of the variable declared in a
for-init-statement. */
+ sk_function_parms, /* The scope containing function parameters. */
+ sk_class, /* The scope containing the members of a class. */
+ sk_namespace, /* The scope containing the members of a
+ namespace, including the global scope. */
sk_template_parms, /* A scope for template parameters. */
- sk_template_spec /* A scope corresponding to a template
- specialization. There is never anything in
- this scope. */
+ sk_template_spec /* Like sk_template_parms, but for an explicit
+ specialization. Since, by definition, an
+ explicit specialization is introduced by
+ "template <>", this scope is always empty. */
} scope_kind;
/* Various kinds of template specialization, instantiation, etc. */
@@ -3622,6 +3619,7 @@ extern void cxx_mark_function_context (struct function *);
extern int toplevel_bindings_p (void);
extern int namespace_bindings_p (void);
extern void keep_next_level (int);
+extern scope_kind innermost_scope_kind (void);
extern int template_parm_scope_p (void);
extern void set_class_shadows (tree);
extern void maybe_push_cleanup_level (tree);