pt.c (determine_specialization): Ignore artificial functions.
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Sun, 20 May 2001 13:22:24 +0000 (13:22 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Sun, 20 May 2001 13:22:24 +0000 (13:22 +0000)
2001-05-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

* pt.c (determine_specialization): Ignore artificial functions.

2001-05-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

* g++.old-deja/g++.pt/spec41.C: New test.

From-SVN: r42342

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

index 233f804fe7e21be16a869346324497be7fbd1e09..42d2ae174a5c2ac1476a4e9245eafed18da0bad3 100644 (file)
@@ -1,3 +1,7 @@
+2001-05-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       * pt.c (determine_specialization): Ignore artificial functions.
+
 2001-05-20  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * cp-tree.h (struct lang_identifier, C_RID_YYCODE): Update.
index c0cd2ebc42dafd3827dc548a6441fc7b0d9bbb83..da0b0a664630efc458daa7c3cf2d12bd5b65add2 100644 (file)
@@ -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;
index ac40b1441d2cc5428cfb73ce888929301d233fe7..a39d8cca15c04d503bfb43964c6d5a739ad610aa 100644 (file)
@@ -1,3 +1,7 @@
+2001-05-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       * g++.old-deja/g++.pt/spec41.C: New test.
+
 2001-05-19  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * 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 (file)
index 0000000..aab53c0
--- /dev/null
@@ -0,0 +1,10 @@
+// Build don't link:
+
+// Origin: <mikes@nilenet.com>
+
+// Bug: Specialization of implicitly created function should be
+// rejected.
+
+template<class T> class blah{};
+blah<char>::blah(){}           // ERROR - invalid specialization
+int main(){}