decl.c (lookup_name_real): OK, do return the from_obj value unless got_object depends...
authorJason Merrill <jason@yorick.cygnus.com>
Sat, 25 Jul 1998 03:19:28 +0000 (03:19 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 25 Jul 1998 03:19:28 +0000 (23:19 -0400)
* decl.c (lookup_name_real): OK, do return the from_obj value
unless got_object depends on template parms.

From-SVN: r21370

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

index 127c8e9998c0c492d9f4d0a1f7b0abee1f27502d..c44d18a9627cafa1e4a69effe4cd23355eb9df0b 100644 (file)
@@ -1,5 +1,8 @@
 1998-07-24  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * decl.c (lookup_name_real): OK, do return the from_obj value
+       unless got_object depends on template parms.
+
        * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT.
 
        * pt.c (coerce_template_parms): Also complain about local enums.
index f25c7008d63b7b3711c6a52e272c75f785821f16..0149679cb9e8f4faf466c0daf03c6ba60bb0bb59 100644 (file)
@@ -5085,8 +5085,11 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only)
                          TREE_TYPE (val));
            }
 
-         /* We don't change val to from_obj here because that breaks
-            implicit typename for destructor calls.  */
+         /* We don't change val to from_obj if got_object depends on
+            template parms because that breaks implicit typename for
+            destructor calls.  */
+         if (! uses_template_parms (got_object))
+           val = got_object;
        }
 
       if ((TREE_CODE (val) == TEMPLATE_DECL && looking_for_template)