From: Mark Mitchell Date: Sun, 26 Apr 1998 12:34:42 +0000 (+0000) Subject: pt.c (check_explicit_specialization): Handle overloaded constructors correctly. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=42da2fd81b78cbd3cf2951b3d35c01d8693977ac;p=gcc.git pt.c (check_explicit_specialization): Handle overloaded constructors correctly. * pt.c (check_explicit_specialization): Handle overloaded constructors correctly. From-SVN: r19413 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index eb764e85be1..323d0e414b6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +Sun Apr 26 12:10:18 1998 Mark Mitchell + + * pt.c (check_explicit_specialization): Handle overloaded + constructors correctly. + Thu Apr 23 21:19:06 1998 Jason Merrill * cp-tree.def: Add WRAPPER. USER_CONV now only has two ops. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5284e7654ea..01868c55f3f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 index 00000000000..62062f7bfe9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/instantiate3.C @@ -0,0 +1,10 @@ +// Build don't link: + +template +struct S +{ + S(const T&) {} + S(int, long); +}; + +template S::S(const double&);