]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/27315 (ICE with ill-placed expression)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 15 May 2006 09:13:51 +0000 (09:13 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 15 May 2006 09:13:51 +0000 (09:13 +0000)
PR c++/27315
* pt.c (do_decl_instantiation): Return early on invalid decl.

* g++.dg/template/operator6.C: New test.
* g++.dg/template/incomplete3.C: New test.

From-SVN: r113780

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

index 26fa4eea0ed515760e6e4b6300f21b077123758f..58d3c45765921b568790fa9788d6c2a4b6e35be7 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-15  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27315
+       * pt.c (do_decl_instantiation): Return early on invalid decl.
+
 2006-05-11  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27547
index 8277fc5972fecbaf68f447c599367ab2aec29e6e..26c63d81759b93ebe4d1842ca26200d4b5269614 100644 (file)
@@ -11042,7 +11042,7 @@ do_decl_instantiation (tree decl, tree storage)
   tree result = NULL_TREE;
   int extern_p = 0;
 
-  if (!decl)
+  if (!decl || decl == error_mark_node)
     /* An error occurred, for which grokdeclarator has already issued
        an appropriate message.  */
     return;
index b1e075fe42fcca4ceceba5d89b48cd21c16f0871..2b68cad1a3db1e984c70a223dacde331958f710e 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-15  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27315
+       * g++.dg/template/operator6.C: New test.
+       * g++.dg/template/incomplete3.C: New test.
+
 2005-05-13  Zdenek Dvorak  <dvorakz@suse.cz>
 
        PR rtl-optimization/27335
diff --git a/gcc/testsuite/g++.dg/template/incomplete3.C b/gcc/testsuite/g++.dg/template/incomplete3.C
new file mode 100644 (file)
index 0000000..39a2f23
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/27315
+// { dg-do compile }
+
+struct A;                  // { dg-error "forward declaration" }
+template void A::foo<0>(); // { dg-error "before|undefined" }
diff --git a/gcc/testsuite/g++.dg/template/operator6.C b/gcc/testsuite/g++.dg/template/operator6.C
new file mode 100644 (file)
index 0000000..94a869b
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/27315
+// { dg-do compile }
+
+template void operator+; // { dg-error "non-function" }