mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 14:21:20 +08:00
re PR c++/27315 (ICE with ill-placed expression)
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: r113778
This commit is contained in:
parent
7c60008e24
commit
ad47b891c8
gcc
@ -1,5 +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.
|
||||
|
||||
PR c++/27559
|
||||
* pt.c (push_template_decl_real): Return error_mark_node instead
|
||||
of broken decl.
|
||||
|
@ -11215,7 +11215,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;
|
||||
|
@ -1,5 +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.
|
||||
|
||||
PR c++/27559
|
||||
* g++.dg/template/new4.C: New test.
|
||||
|
||||
|
5
gcc/testsuite/g++.dg/template/incomplete3.C
Normal file
5
gcc/testsuite/g++.dg/template/incomplete3.C
Normal file
@ -0,0 +1,5 @@
|
||||
// PR c++/27315
|
||||
// { dg-do compile }
|
||||
|
||||
struct A; // { dg-error "forward declaration" }
|
||||
template void A::foo<0>(); // { dg-error "before|incomplete" }
|
4
gcc/testsuite/g++.dg/template/operator6.C
Normal file
4
gcc/testsuite/g++.dg/template/operator6.C
Normal file
@ -0,0 +1,4 @@
|
||||
// PR c++/27315
|
||||
// { dg-do compile }
|
||||
|
||||
template void operator+; // { dg-error "non-function" }
|
Loading…
x
Reference in New Issue
Block a user