]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* search.c (envelope_add_decl): Tweak for implicit typename.
authorJason Merrill <jason@yorick.cygnus.com>
Sat, 6 Jun 1998 18:13:12 +0000 (18:13 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 6 Jun 1998 18:13:12 +0000 (14:13 -0400)
From-SVN: r20264

gcc/cp/ChangeLog
gcc/cp/search.c

index 65a4819edbb420ec04cd604ecf62f52094a72150..cec9536bf72370fe319c046d5825db9e3afc2e2d 100644 (file)
@@ -1,5 +1,7 @@
 1998-06-05  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * search.c (envelope_add_decl): Tweak for implicit typename.
+
        * call.c (joust): Also warn about confusing conversion op/constructor
        overload resolution.
 
index d2ad247d38ae9452065f32350e9cec17a525b969..6d2a5309ff5991b5aec49e60f17782eec2ff67e2 100644 (file)
@@ -3333,6 +3333,12 @@ envelope_add_decl (type, decl, values)
   tree name = DECL_NAME (decl);
   int dont_add = 0;
 
+  /* Yet Another Implicit Typename Kludge:  Since we don't tsubst
+     the members for partial instantiations, DECL_CONTEXT (decl) is wrong.
+     But pretend it's right for this function.  */
+  if (processing_template_decl)
+    type = DECL_REAL_CONTEXT (decl);
+
   /* virtual base names are always unique.  */
   if (VBASE_NAME_P (name))
     *values = NULL_TREE;
@@ -3354,10 +3360,7 @@ envelope_add_decl (type, decl, values)
          warning ("in this context");
        }
 
-      context = (TREE_CODE (value) == FUNCTION_DECL
-                && DECL_VIRTUAL_P (value))
-       ? DECL_CLASS_CONTEXT (value)
-         : DECL_CONTEXT (value);
+      context = DECL_REAL_CONTEXT (value);
 
       if (context == type)
        {