diff options
author | Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> | 2003-10-20 12:42:37 +0000 |
---|---|---|
committer | Kriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org> | 2003-10-20 12:42:37 +0000 |
commit | 11325dcdbdad0d7744dd92d65174777555e8531e (patch) | |
tree | 3889a0af25f3e42e85de9eb3f6a37620a052feda /gcc/cp/pt.c | |
parent | adccacc41df4afbdaaa6a5b45364a51708e56088 (diff) | |
download | gcc-11325dcdbdad0d7744dd92d65174777555e8531e.zip gcc-11325dcdbdad0d7744dd92d65174777555e8531e.tar.gz gcc-11325dcdbdad0d7744dd92d65174777555e8531e.tar.bz2 |
PR c++/9781, c++/10583, c++/11862
PR c++/9781, c++/10583, c++/11862
* decl.c (cp_finish_decl): Exit immediately if decl is an
error_mark_node.
* pt.c (push_template_decl_real): Return error_mark_node for
invalid template declaration of variable.
* g++.dg/parse/crash13.C: New test.
From-SVN: r72701
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 32b146f..3470193 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2690,7 +2690,10 @@ push_template_decl_real (tree decl, int is_friend) || TREE_CODE (decl) == FUNCTION_DECL) /* OK */; else - error ("template declaration of `%#D'", decl); + { + error ("template declaration of `%#D'", decl); + return error_mark_node; + } } /* Check to see that the rules regarding the use of default |