pt.c (check_explicit_specialization): Handle overloaded constructors correctly.
authorMark Mitchell <mmitchell@usa.net>
Sun, 26 Apr 1998 12:34:42 +0000 (12:34 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 26 Apr 1998 12:34:42 +0000 (12:34 +0000)
* pt.c (check_explicit_specialization): Handle overloaded
constructors correctly.

From-SVN: r19413

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.old-deja/g++.pt/instantiate3.C [new file with mode: 0644]

index eb764e85be15bd16f8e2361db87619bebd043bda..323d0e414b66af54a0fbe14d1722107257a5aaec 100644 (file)
@@ -1,3 +1,8 @@
+Sun Apr 26 12:10:18 1998  Mark Mitchell  <mmitchell@usa.net>
+
+       * pt.c (check_explicit_specialization): Handle overloaded
+       constructors correctly.
+
 Thu Apr 23 21:19:06 1998  Jason Merrill  <jason@yorick.cygnus.com>
 
        * cp-tree.def: Add WRAPPER.  USER_CONV now only has two ops.
index 5284e7654ea04ab847dec9c939d227aedc0aa540..01868c55f3fd42d8f15e9ab9098ed4b51b42dd77 100644 (file)
@@ -1041,12 +1041,10 @@ check_explicit_specialization (declarator, decl, template_count, flags)
                  return decl;
                }
 
-             fns = TREE_VEC_ELT(CLASSTYPE_METHOD_VEC (ctype),
-                                is_constructor ? 0 : 1);
+             name = is_constructor ? ctor_identifier : dtor_identifier;
            }
-         else 
-           fns = lookup_fnfields (TYPE_BINFO (ctype), name,
-                                  1);
+
+         fns = lookup_fnfields (TYPE_BINFO (ctype), name, 1);
          
          if (fns == NULL_TREE) 
            {
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/instantiate3.C b/gcc/testsuite/g++.old-deja/g++.pt/instantiate3.C
new file mode 100644 (file)
index 0000000..62062f7
--- /dev/null
@@ -0,0 +1,10 @@
+// Build don't link:
+
+template <class T>
+struct S
+{
+  S(const T&) {}
+  S(int, long);
+};
+
+template S<double>::S(const double&);