From: Kriang Lerdsuwanakij Date: Sun, 20 May 2001 13:22:24 +0000 (+0000) Subject: pt.c (determine_specialization): Ignore artificial functions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b82c249189ff6349ca7d8407258cb9745fd3b17;p=gcc.git pt.c (determine_specialization): Ignore artificial functions. 2001-05-20 Kriang Lerdsuwanakij * pt.c (determine_specialization): Ignore artificial functions. 2001-05-20 Kriang Lerdsuwanakij * g++.old-deja/g++.pt/spec41.C: New test. From-SVN: r42342 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 233f804fe7e..42d2ae174a5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2001-05-20 Kriang Lerdsuwanakij + + * pt.c (determine_specialization): Ignore artificial functions. + 2001-05-20 Neil Booth * cp-tree.h (struct lang_identifier, C_RID_YYCODE): Update. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c0cd2ebc42d..da0b0a66463 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1023,6 +1023,9 @@ determine_specialization (template_id, decl, targs_out, /* This is just an ordinary non-member function. Nothing can be a specialization of that. */ continue; + else if (DECL_ARTIFICIAL (fn)) + /* Cannot specialize functions that are created implicitly. */ + continue; else { tree decl_arg_types; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ac40b1441d2..a39d8cca15c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-05-20 Kriang Lerdsuwanakij + + * g++.old-deja/g++.pt/spec41.C: New test. + 2001-05-19 Joseph S. Myers * gcc.c-torture/compile/20010114-1.x: Remove. diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec41.C b/gcc/testsuite/g++.old-deja/g++.pt/spec41.C new file mode 100644 index 00000000000..aab53c074c1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/spec41.C @@ -0,0 +1,10 @@ +// Build don't link: + +// Origin: + +// Bug: Specialization of implicitly created function should be +// rejected. + +template class blah{}; +blah::blah(){} // ERROR - invalid specialization +int main(){}