]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/27713 (ICE on invalid operator new)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 29 May 2006 19:22:18 +0000 (19:22 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 29 May 2006 19:22:18 +0000 (19:22 +0000)
PR c++/27713
* pt.c (push_template_decl_real): Return error_mark_node instead
of broken decl.

* g++.dg/template/new6.C: New test.

From-SVN: r114211

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/new6.C [new file with mode: 0644]

index 7e1d11e19dbb10fa917acba311f2a68530692e1c..2adc989797602bbb2184d4bb75873dcf3587d38f 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-29  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27713
+       * pt.c (push_template_decl_real): Return error_mark_node instead
+       of broken decl.
+
 2006-05-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27716
index 0b7f2e67c6b5be7515f2b3aab53ea2a135a4845a..e4b2d70add85567a5dcd84405a658dbf0e23470e 100644 (file)
@@ -2979,7 +2979,7 @@ push_template_decl_real (tree decl, int is_friend)
                 template. ... Template allocation functions shall
                 have two or more parameters.  */
              error ("invalid template declaration of %qD", decl);
-             return decl;
+             return error_mark_node;
            }
        }
       else if (DECL_IMPLICIT_TYPEDEF_P (decl)
index 3b28f118103e1f6e180ab8eb74f31b9f35cd5295..48a2af657d408652cbf05ec0404332741b624cee 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-29  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27713
+       * g++.dg/template/new6.C: New test.
+
 2006-05-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27716
diff --git a/gcc/testsuite/g++.dg/template/new6.C b/gcc/testsuite/g++.dg/template/new6.C
new file mode 100644 (file)
index 0000000..4db0685
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/27713
+// { dg-do compile }
+
+struct A
+{
+  template<int> friend void* operator new(__SIZE_TYPE__); // { dg-error "invalid template" }
+};