init.c (build_member_call): Lookup names coming from namespace-scoped LOOKUP_EXPR.
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>
Mon, 3 May 1999 12:20:47 +0000 (12:20 +0000)
committerMartin v. Löwis <loewis@gcc.gnu.org>
Mon, 3 May 1999 12:20:47 +0000 (12:20 +0000)
        * init.c (build_member_call): Lookup names coming from
        namespace-scoped LOOKUP_EXPR.

From-SVN: r26745

gcc/cp/ChangeLog
gcc/cp/init.c

index 2caad4ec75611617c0ce797b6a4edcfcfd991382..231047669dd4737eebeddff1b365221dd043d8e4 100644 (file)
@@ -1,3 +1,8 @@
+1999-05-02  Martin von Löwis  <loewis@informatik.hu-berlin.de>
+
+       * init.c (build_member_call): Lookup names coming from
+       namespace-scoped LOOKUP_EXPR.
+
 1999-05-03  Jim Blandy  <jimb@zwingli.cygnus.com>
 
        * gxxint.texi: Add documentation for 'I'.
index 492a1ce04474a5929ddcd4a53e75f13be865eb0a..e9fe895da0597ae801d2bead818bd666f27f627f 100644 (file)
@@ -1366,7 +1366,18 @@ build_member_call (type, name, parmlist)
     {
       /* 'name' already refers to the decls from the namespace, since we
         hit do_identifier for template_ids.  */
-      my_friendly_assert (is_overloaded_fn (TREE_OPERAND (name, 0)), 980519);
+      method_name = TREE_OPERAND (name, 0);
+      /* FIXME: Since we don't do independent names right yet, the
+        name might also be a LOOKUP_EXPR. Once we resolve this to a
+        real decl earlier, this can go. This may happen during
+        tsubst'ing.  */
+      if (TREE_CODE (method_name) == LOOKUP_EXPR)
+       {
+         method_name = lookup_namespace_name 
+           (type, TREE_OPERAND (method_name, 0));
+         TREE_OPERAND (name, 0) = method_name;
+       }
+      my_friendly_assert (is_overloaded_fn (method_name), 980519);
       return build_x_function_call (name, parmlist, current_class_ref);
     }