This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH: PR 14510


This patch fixes a name-lookup regression that prevented ACE from
building with GCC 3.4.

Tested on i686-pc-linux-gnu, applied on the mainline and on the 3.4
branch.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
 
2004-03-10  Mark Mitchell  <mark@codesourcery.com>

	PR c++/14510
	* decl.c (xref_tag): Disregard non-type declarations when
	looking up a tagged type. 

2004-03-10  Mark Mitchell  <mark@codesourcery.com>

	PR c++/14510
	* g++.dg/lookup/struct2.C: New test.

Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1174.2.12
diff -c -5 -p -r1.1174.2.12 decl.c
*** cp/decl.c	8 Mar 2004 23:00:25 -0000	1.1174.2.12
--- cp/decl.c	11 Mar 2004 03:35:21 -0000
*************** xref_tag (enum tag_types tag_code, tree 
*** 9359,9369 ****
  	 this scope and don't try to find it as a type.  */
        t = lookup_tag (code, name, b, 1);
      }
    else
      {
!       tree decl = lookup_name (name, 1);
  
        if (decl && DECL_CLASS_TEMPLATE_P (decl))
  	decl = DECL_TEMPLATE_RESULT (decl);
  
        if (decl && TREE_CODE (decl) == TYPE_DECL)
--- 9359,9369 ----
  	 this scope and don't try to find it as a type.  */
        t = lookup_tag (code, name, b, 1);
      }
    else
      {
!       tree decl = lookup_name (name, 2);
  
        if (decl && DECL_CLASS_TEMPLATE_P (decl))
  	decl = DECL_TEMPLATE_RESULT (decl);
  
        if (decl && TREE_CODE (decl) == TYPE_DECL)
Index: testsuite/g++.dg/lookup/struct2.C
===================================================================
RCS file: testsuite/g++.dg/lookup/struct2.C
diff -N testsuite/g++.dg/lookup/struct2.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/lookup/struct2.C	11 Mar 2004 03:35:24 -0000
***************
*** 0 ****
--- 1,7 ----
+ // PR c++/14510
+ 
+ struct c {};
+ namespace A {
+   int c(struct c*req);
+ }
+ int A::c(struct c*req) {}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]