decl.c (lookup_name_real): Do nested field lookup regardless of TYPE_BEING_DEFINED.
authorJason Merrill <jason@yorick.cygnus.com>
Wed, 24 Mar 1999 02:41:55 +0000 (02:41 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 24 Mar 1999 02:41:55 +0000 (21:41 -0500)
* decl.c (lookup_name_real): Do nested field lookup regardless of
TYPE_BEING_DEFINED.

From-SVN: r25943

gcc/cp/ChangeLog
gcc/cp/decl.c

index d0f66bce36e7693dd881b613f14b3abcd97ccfd7..4a28e4b8ed1c9f7b99d3026874ef22987240fdab 100644 (file)
@@ -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
index 64c8a6595f5ca94d96c7713bd44723c8cd6d8faf..6779045203a36e3f8cc8736011b01ab4c70c27a5 100644 (file)
@@ -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