From: Jason Merrill Date: Wed, 24 Mar 1999 02:41:55 +0000 (+0000) Subject: decl.c (lookup_name_real): Do nested field lookup regardless of TYPE_BEING_DEFINED. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9747e84add3340a5be5ba3efcc3d2c75377dd5f8;p=gcc.git decl.c (lookup_name_real): Do nested field lookup regardless of TYPE_BEING_DEFINED. * decl.c (lookup_name_real): Do nested field lookup regardless of TYPE_BEING_DEFINED. From-SVN: r25943 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d0f66bce36e..4a28e4b8ed1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1999-03-24 Jason Merrill + + * decl.c (lookup_name_real): Do nested field lookup regardless of + TYPE_BEING_DEFINED. + 1999-03-24 Mark Mitchell * cp-tree.h (lang_type): Remove has_assignment and diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 64c8a6595f5..6779045203a 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5503,13 +5503,12 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only) 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); - } + 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