diff options
author | Nathan Sidwell <nathan@acm.org> | 2001-01-08 11:30:22 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2001-01-08 11:30:22 +0000 |
commit | 76191fdd29924d1d6a0b6f7d5696d73988e8411e (patch) | |
tree | 085c7755570eb2bcb0344272c189c84fd6fb9733 | |
parent | 02fbf2d20d1d37ec75b3d6759fe001732e6595bc (diff) | |
download | gcc-76191fdd29924d1d6a0b6f7d5696d73988e8411e.zip gcc-76191fdd29924d1d6a0b6f7d5696d73988e8411e.tar.gz gcc-76191fdd29924d1d6a0b6f7d5696d73988e8411e.tar.bz2 |
decl.c (struct binding_level): Adjust class_shadowed comments to reflect reality.
cp:
* decl.c (struct binding_level): Adjust class_shadowed comments
to reflect reality.
(push_class_level_binding): Ajust comments to reflect reality.
Set IDENTIFIER_CLASS_VALUE when replacing an existing binding.
Don't set TREE_VALUE on the class_shadowed list.
testsuite:
* g++.old-deja/g++.other/lookup16.C: Remove XFAIL.
From-SVN: r38796
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/decl.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/lookup16.C | 3 |
4 files changed, 21 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0f4e41c..9e4b99e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2001-01-08 Nathan Sidwell <nathan@acm.org> + + * decl.c (struct binding_level): Adjust class_shadowed comments + to reflect reality. + (push_class_level_binding): Ajust comments to reflect reality. + Set IDENTIFIER_CLASS_VALUE when replacing an existing binding. + Don't set TREE_VALUE on the class_shadowed list. + 2001-01-07 Mark Mitchell <mark@codesourcery.com> * decl2.c (grokfield): Don't accept `asm' specifiers for diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 636b50c..e15e77c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -391,15 +391,13 @@ struct binding_level /* If this binding level is the binding level for a class, then class_shadowed is a TREE_LIST. The TREE_PURPOSE of each node - is the name of an entity bound in the class; the TREE_VALUE is - the IDENTIFIER_CLASS_VALUE before we entered the class. Thus, - when leaving class scope, we can restore the - IDENTIFIER_CLASS_VALUE by walking this list. The TREE_TYPE is + is the name of an entity bound in the class. The TREE_TYPE is the DECL bound by this name in the class. */ tree class_shadowed; /* Similar to class_shadowed, but for IDENTIFIER_TYPE_VALUE, and - is used for all binding levels. */ + is used for all binding levels. In addition the TREE_VALUE is the + IDENTIFIER_TYPE_VALUE before we entered the class. */ tree type_shadowed; /* A TREE_LIST. Each TREE_VALUE is the LABEL_DECL for a local @@ -4408,9 +4406,8 @@ push_class_level_binding (name, x) else old_decl = BINDING_VALUE (binding); - /* There was already a binding for X containing fewer - functions than are named in X. Find the previous - declaration of X on the class-shadowed list, and update it. */ + /* Find the previous binding of name on the class-shadowed + list, and update it. */ for (shadow = class_binding_level->class_shadowed; shadow; shadow = TREE_CHAIN (shadow)) @@ -4420,17 +4417,17 @@ push_class_level_binding (name, x) BINDING_VALUE (binding) = x; INHERITED_VALUE_BINDING_P (binding) = 0; TREE_TYPE (shadow) = x; + IDENTIFIER_CLASS_VALUE (name) = x; return; } } /* If we didn't replace an existing binding, put the binding on the - stack of bindings for the identifier, and update - IDENTIFIER_CLASS_VALUE. */ + stack of bindings for the identifier, and update the shadowed list. */ if (push_class_binding (name, x)) { class_binding_level->class_shadowed - = tree_cons (name, IDENTIFIER_CLASS_VALUE (name), + = tree_cons (name, NULL, class_binding_level->class_shadowed); /* Record the value we are binding NAME to so that we can know what to pop later. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 87b4b6f..0e7dd5a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-01-08 Nathan Sidwell <nathan@acm.org> + + * g++.old-deja/g++.other/lookup16.C: Remove XFAIL. + 2001-01-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * gcc.c-torture/execute/stdio-opt-3.c: New test. diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup16.C b/gcc/testsuite/g++.old-deja/g++.other/lookup16.C index 32fc477..150eb07 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/lookup16.C +++ b/gcc/testsuite/g++.old-deja/g++.other/lookup16.C @@ -2,11 +2,10 @@ // Copyright (C) 1999 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 25 Aug 1999 <nathan@acm.org> +// Bug 3 // typenames are not injected early enough, [basic.scope.pdecl]3.3.1/4 // indicates this should compile. -// excess errors test - XFAIL - struct A { }; |