diff options
| author | giovannibajo <giovannibajo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-03 02:19:27 +0000 |
|---|---|---|
| committer | giovannibajo <giovannibajo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-03 02:19:27 +0000 |
| commit | 93ceb69bb59aca832498d1e3877dafd136f5d27a (patch) | |
| tree | 99ab5461a3e7691bb95fa81acf5604562d732ade | |
| parent | f0f05655693152f8c0a8e3c08f34f725324a8a7e (diff) | |
| download | ppe42-gcc-93ceb69bb59aca832498d1e3877dafd136f5d27a.tar.gz ppe42-gcc-93ceb69bb59aca832498d1e3877dafd136f5d27a.zip | |
PR c++/3761
* name-lookup.c (push_class_level_binding): Don't pass a
TREE_LIST of ambiguous names to check_template_shadow as it
only handles declarations. Instead, pull the declaration
out and pass that.
PR c++/3761
* g++.dg/lookup/crash4.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84045 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/cp/name-lookup.c | 13 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/lookup/crash4.C | 18 |
4 files changed, 43 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cd5dc6644bd..8baadc015a2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2004-07-03 Scott Brumbaugh <scottb.lists@verizon.net>
+
+ PR c++/3761
+ * name-lookup.c (push_class_level_binding): Don't pass a
+ TREE_LIST of ambiguous names to check_template_shadow as it
+ only handles declarations. Instead, pull the declaration
+ out and pass that.
+ 2004-07-03 Giovanni Bajo <giovannibajo@gcc.gnu.org> PR c++/14971 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index e449631fdec..ef1668938d5 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2777,7 +2777,18 @@ push_class_level_binding (tree name, tree x) /* Make sure that this new member does not have the same name as a template parameter. */ if (TYPE_BEING_DEFINED (current_class_type)) - check_template_shadow (x); + { + tree decl = x; + + /* We could have been passed a tree list if this is an ambiguous + declaration. If so, pull the declaration out because + check_template_shadow will not handle a TREE_LIST. */ + if (TREE_CODE (decl) == TREE_LIST + && TREE_TYPE (decl) == error_mark_node) + decl = TREE_VALUE (decl); + + check_template_shadow (decl); + } /* [class.mem] diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2ba74a1b3dd..cc8bd6e0c4a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-07-03 Scott Brumbaugh <scottb.lists@verizon.net>
+
+ PR c++/3761
+ * g++.dg/lookup/crash4.C: New test.
+ 2004-07-02 Zack Weinberg <zack@codesourcery.com> * gcc.c-torture/execute/builtin-abs-1.c diff --git a/gcc/testsuite/g++.dg/lookup/crash4.C b/gcc/testsuite/g++.dg/lookup/crash4.C new file mode 100644 index 00000000000..65686512a9d --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/crash4.C @@ -0,0 +1,18 @@ +// { dg-do compile } +// +// PR 3761 + +struct A {}; + +struct B {}; + +template <class T> +struct Foo : A, B +{ + void func(void); + + struct Nested + { + friend void Foo::func(void); + }; +}; |

