]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
init.c (build_offset_ref): Handle the case of a templated member function.
authorTheodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
Mon, 20 Mar 2000 17:44:24 +0000 (18:44 +0100)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 20 Mar 2000 17:44:24 +0000 (12:44 -0500)
        * init.c (build_offset_ref): Handle the case of a templated member
        function.

From-SVN: r32649

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

index 83cec30b863bb1578fe6695afa3725c8370efe44..f1a2f8adcbe4b2396d4f2999d66335e4388fd6cb 100644 (file)
@@ -1,3 +1,8 @@
+2000-03-20 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+       * init.c (build_offset_ref): Handle the case of a templated member
+       function.
+    
 2000-03-19  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
 
        * except.c (expand_exception_blocks): Clear catch_clauses_last.
index 8994f604239271e26d6864c567cd37caf226293f..f2aba2ced827d256f10e074f4453cbe1a3e0edc2 100644 (file)
@@ -1577,9 +1577,21 @@ build_offset_ref (type, name)
         the template-id that was used.  */
       name = TREE_OPERAND (orig_name, 0);
 
-      if (TREE_CODE (name) == LOOKUP_EXPR)
-       /* This can happen during tsubst'ing.  */
-       name = TREE_OPERAND (name, 0);
+      if (DECL_P (name))
+       name = DECL_NAME (name);
+      else
+       {
+         if (TREE_CODE (name) == LOOKUP_EXPR)
+           /* This can happen during tsubst'ing.  */
+           name = TREE_OPERAND (name, 0);
+         else
+           {
+             if (TREE_CODE (name) == COMPONENT_REF)
+               name = TREE_OPERAND (name, 1);
+             if (TREE_CODE (name) == OVERLOAD)
+               name = DECL_NAME (OVL_CURRENT (name));
+           }
+       }
 
       my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0);
     }