diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1999-03-24 02:41:55 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-03-23 21:41:55 -0500 |
commit | 9747e84add3340a5be5ba3efcc3d2c75377dd5f8 (patch) | |
tree | 296069b8e4f47da911e6a64f0a6d3a9dac99d3e7 /gcc | |
parent | 2ced0b14a9235e886f415fd3f2cf312ec3734ab0 (diff) | |
download | gcc-9747e84add3340a5be5ba3efcc3d2c75377dd5f8.zip gcc-9747e84add3340a5be5ba3efcc3d2c75377dd5f8.tar.gz gcc-9747e84add3340a5be5ba3efcc3d2c75377dd5f8.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 13 |
2 files changed, 11 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d0f66bc..4a28e4b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1999-03-24 Jason Merrill <jason@yorick.cygnus.com> + + * decl.c (lookup_name_real): Do nested field lookup regardless of + TYPE_BEING_DEFINED. + 1999-03-24 Mark Mitchell <mark@codesourcery.com> * cp-tree.h (lang_type): Remove has_assignment and diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 64c8a65..6779045 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 |