* decl.c (lookup_name_real): Simplify suggested fix.
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 29 Oct 1998 21:54:57 +0000 (21:54 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 29 Oct 1998 21:54:57 +0000 (16:54 -0500)
From-SVN: r23439

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

index 122977e282a4a0e4efb2a8d99e60fe21b24268df..bd3c0f14bd84aeefdb41df49c8737c7cb1c3c948 100644 (file)
@@ -1,6 +1,7 @@
 1998-10-29  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl.c (lookup_name_real): OK, only warn if not lexing.
+       Simplify suggested fix.
 
        * cp-tree.h (IDENTIFIER_MARKED): New macro.
        * search.c (lookup_conversions): Use breadth_first_search.
index ff1dc1b39f7fb36ded0f16aad224b24a9f505afe..6e0a409dd445badaf2907e1b1e7814d7d886e63a 100644 (file)
@@ -5243,17 +5243,11 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only)
              && ! (TREE_CODE (locval) == TYPE_DECL
                    && comptypes (TREE_TYPE (locval), subtype, 1)))
            {
-             static int explained;
-
              cp_warning ("lookup of `%D' finds `%#D'", name, locval);
-             cp_warning
-               ("  instead of `%D' from dependent base class", classval);
-             if (! explained)
-               {
-                 explained = 1;
-                 cp_warning ("  (use `typename %D' if that's what you meant)",
-                             classval);
-               }
+             cp_warning ("  instead of `%D' from dependent base class",
+                         classval);
+             cp_warning ("  (use `typename %T::%D' if that's what you meant)",
+                         constructor_name (current_class_type), name);
            }
        }
     }