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++) nested field name lookup patch


Fixes g++.other/lookup10.C.

1999-03-24  Jason Merrill  <jason@yorick.cygnus.com>

	* decl.c (lookup_name_real): Do nested field lookup regardless of
	TYPE_BEING_DEFINED.

Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.328
diff -c -p -r1.328 decl.c
*** decl.c	1999/03/24 01:10:06	1.328
--- decl.c	1999/03/24 10:34:10
*************** lookup_name_real (name, prefer_type, non
*** 5503,5515 ****
       classes explicitly.  */
    if (!val && !nonclass 
        && current_class_type && TYPE_BEING_DEFINED (current_class_type))
!     {
!       val = qualify_lookup (lookup_field (current_class_type, name, 0, 0),
! 			    flags);
!       if (!val)
! 	val = qualify_lookup (lookup_nested_field (name, !yylex),
! 			      flags);
!     }
    
    /* If we found a type from a dependent base class (using the
       implicit typename extension) make sure that there's not some
--- 5503,5514 ----
       classes explicitly.  */
    if (!val && !nonclass 
        && current_class_type && TYPE_BEING_DEFINED (current_class_type))
!     val = qualify_lookup (lookup_field (current_class_type, name, 0, 0),
! 			  flags);
! 
!   /* The name might be from an enclosing class of the current scope.  */
!   if (!val && !nonclass && current_class_type)
!     val = qualify_lookup (lookup_nested_field (name, !yylex), flags);
    
    /* If we found a type from a dependent base class (using the
       implicit typename extension) make sure that there's not some


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