aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-07-14 15:34:30 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-07-14 15:34:30 +0000
commit90ea9897a0940659bc41355d41573fde6c35617a (patch)
tree5c6490013ea86502c34dbabd84c9be78d2ebd025 /gcc/cp/pt.c
parent95674810682ca0c2862094c96cdfa5537113693c (diff)
downloadgcc-90ea9897a0940659bc41355d41573fde6c35617a.zip
gcc-90ea9897a0940659bc41355d41573fde6c35617a.tar.gz
gcc-90ea9897a0940659bc41355d41573fde6c35617a.tar.bz2
cp-tree.h (IDENTIFIER_VALUE): Remove.
* cp-tree.h (IDENTIFIER_VALUE): Remove. (BINFO_PUSHDECLS_MARKED): Likewise. (maybe_inject_for_scope_var): Likewise. (push_class_decls): Likewise. * name-lookup.h (push_class_binding): Remove. (innermost_non_namespace_value): New function. (outer_binding): Likewise. * class.c (add_method): Push bindings before adding to TYPE_METHODS. (restore_class_cache): Do not restore class_shadowed. (pushclass): Do not add USING_DECLs. Do not call push_class_decls. * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c. * decl.c (pushdecl): Use outer_binding. (poplevel): Set the scope for an out-of-scope for-loop declaration appropriately. (cp_finish_decl): Don't call maybe_inject_for_scope_var. * name-lookup.c (new_class_binding): New function. (push_binding): Use it. (pushdecl): Use innermost_non_namespace_value. (maybe_inject_for_scope_var): Remove. (push_class_binding): Remove. (set_inherited_value_binding_p): New function. (get_class_binding): New function. (push_class_level_binding): Assert that the current_class_type is being defined. (outer_binding): New function. (innermost_non_namespace_value): Likewise. (lookup_name_real): Use outer_binding. (lookup_name_current_level): Ignore out-of-scope variables. * pt.c (check_template_shadow): Use innermost_non_namespace_value. (lookup_template_class): Likewise. * search.c (dfs_push_type_decls): Remove. (dfs_push_decls): Likewise. (setup_class_bindings): Likewise. (lookup_field_1): Handle USING_DECLs from dependent scopes. (marked_pushdecls_p): Remove. (unmarked_pushdecls_p): Remove. (marked_identifiers): Remove. (setup_class_bindings): Remove. (dfs_push_type_decls): Remove. (dfs_push_decls): Remove. (push_class_decls): Remove. From-SVN: r84689
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 3d46883..6dd3c64 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -2075,7 +2075,7 @@ check_template_shadow (tree decl)
/* Figure out what we're shadowing. */
if (TREE_CODE (decl) == OVERLOAD)
decl = OVL_CURRENT (decl);
- olddecl = IDENTIFIER_VALUE (DECL_NAME (decl));
+ olddecl = innermost_non_namespace_value (DECL_NAME (decl));
/* If there's no previous binding for this name, we're not shadowing
anything, let alone a template parameter. */
@@ -4156,9 +4156,9 @@ lookup_template_class (tree d1,
if (TREE_CODE (d1) == IDENTIFIER_NODE)
{
- if (IDENTIFIER_VALUE (d1)
- && DECL_TEMPLATE_TEMPLATE_PARM_P (IDENTIFIER_VALUE (d1)))
- template = IDENTIFIER_VALUE (d1);
+ tree value = innermost_non_namespace_value (d1);
+ if (value && DECL_TEMPLATE_TEMPLATE_PARM_P (value))
+ template = value;
else
{
if (context)
@@ -4200,11 +4200,7 @@ lookup_template_class (tree d1,
context = DECL_CONTEXT (template);
}
- /* With something like `template <class T> class X class X { ... };'
- we could end up with D1 having nothing but an IDENTIFIER_VALUE.
- We don't want to do that, but we have to deal with the situation,
- so let's give them some syntax errors to chew on instead of a
- crash. Alternatively D1 might not be a template type at all. */
+ /* Issue an error message if we didn't find a template. */
if (! template)
{
if (complain & tf_error)