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]

(C++) typename patch to lookup_name_real


Fixes g++.ext/typename1.C.

2000-08-11  Jason Merrill  <jason@redhat.com>

	* decl.c (lookup_name_real): Don't forget the TYPENAME_TYPE we're
	looking inside.

Index: decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.668
diff -c -p -r1.668 decl.c
*** decl.c	2000/08/11 09:12:31	1.668
--- decl.c	2000/08/11 23:57:46
*************** lookup_name_real (name, prefer_type, non
*** 5898,5903 ****
--- 5898,5910 ----
  	    {
  	      val = lookup_member (type, name, 0, prefer_type);
  	      type_access_control (type, val);
+ 
+ 	      /* Restore the containing TYPENAME_TYPE if we looked
+ 		 through it before.  */
+ 	      if (got_scope && got_scope != type
+ 		  && val && TREE_CODE (val) == TYPE_DECL
+ 		  && TREE_CODE (TREE_TYPE (val)) == TYPENAME_TYPE)
+ 		TYPE_CONTEXT (TREE_TYPE (val)) = got_scope;
  	    }
  	}
        else

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