* 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
+2004-07-03 Scott Brumbaugh <scottb.lists@verizon.net>\r
+\r
+ PR c++/3761\r
+ * name-lookup.c (push_class_level_binding): Don't pass a\r
+ TREE_LIST of ambiguous names to check_template_shadow as it\r
+ only handles declarations. Instead, pull the declaration \r
+ out and pass that.\r
+
2004-07-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/14971
/* 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]
+2004-07-03 Scott Brumbaugh <scottb.lists@verizon.net>\r
+\r
+ PR c++/3761\r
+ * g++.dg/lookup/crash4.C: New test.\r
+
2004-07-02 Zack Weinberg <zack@codesourcery.com>
* gcc.c-torture/execute/builtin-abs-1.c
--- /dev/null
+// { 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);
+ };
+};