(C++) nested field name lookup patch
Jason Merrill
jason@cygnus.com
Wed Mar 24 02:37:00 GMT 1999
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
More information about the Gcc-patches
mailing list