This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH for yet another name-lookup regression
- To: egcs-patches at egcs dot cygnus dot com
- Subject: C++ PATCH for yet another name-lookup regression
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 8 Apr 1999 13:09:37 -0700
- Reply-to: mark at codesourcery dot com
We're still shaking the bugs out of the name lookup improvements that
went in last week. Here's another small fix.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
1999-04-08 Mark Mitchell <mark@codesourcery.com>
* search.c (template_self_reference_p): Tweak.
Index: testsuite/g++.old-deja/g++.pt/crash34.C
===================================================================
RCS file: crash34.C
diff -N crash34.C
*** /dev/null Sat Dec 5 20:30:03 1998
--- crash34.C Thu Apr 8 11:44:54 1999
***************
*** 0 ****
--- 1,20 ----
+ // Build don't link:
+ // Origin: Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+ template <class T>
+ class A {
+ public:
+ class B { };
+ class C: public B {
+ public:
+ C(A&):B() { }
+ };
+ C f() { return C(*this); }
+ };
+
+ int
+ main()
+ {
+ A<int> a;
+ a.f();
+ }
Index: cp/search.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/search.c,v
retrieving revision 1.93
diff -c -p -r1.93 search.c
*** search.c 1999/04/06 14:38:06 1.93
--- search.c 1999/04/08 18:45:24
*************** template_self_reference_p (type, decl)
*** 1190,1195 ****
--- 1190,1196 ----
tree decl;
{
return (CLASSTYPE_USE_TEMPLATE (type)
+ && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))
&& TREE_CODE (decl) == TYPE_DECL
&& DECL_ARTIFICIAL (decl)
&& DECL_NAME (decl) == constructor_name (type));