aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2008-08-12 19:38:02 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-08-12 19:38:02 +0000
commit905319d95e57f935e3f7fab102901334ee0afa02 (patch)
treef5ba16fa5d24529bdc3f1e9c02895e3b3e7ea501 /gcc/cp/parser.c
parent4d2b059d5e51c6cd6cca3cc775268039657d3317 (diff)
downloadgcc-905319d95e57f935e3f7fab102901334ee0afa02.zip
gcc-905319d95e57f935e3f7fab102901334ee0afa02.tar.gz
gcc-905319d95e57f935e3f7fab102901334ee0afa02.tar.bz2
re PR c++/37087 (Segfault on compiling template defined in wrong namespace.)
/cp 2008-08-12 Paolo Carlini <paolo.carlini@oracle.com> PR c++/37087 * parser.c (cp_parser_class_head): Early return error_mark_node in case of global qualification of class name or qualified name that does not name a class. /testsuite 2008-08-12 Paolo Carlini <paolo.carlini@oracle.com> PR c++/37087 * g++.dg/template/crash80.C: New. * g++.old-deja/g++.other/decl5.C: Adjust. From-SVN: r139034
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 1bb52e5..fd4e1bb 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -14981,11 +14981,17 @@ cp_parser_class_head (cp_parser* parser,
cp_parser_commit_to_tentative_parse (parser);
/* Issue the error about the overly-qualified name now. */
if (qualified_p)
- cp_parser_error (parser,
- "global qualification of class name is invalid");
+ {
+ cp_parser_error (parser,
+ "global qualification of class name is invalid");
+ return error_mark_node;
+ }
else if (invalid_nested_name_p)
- cp_parser_error (parser,
- "qualified name does not name a class");
+ {
+ cp_parser_error (parser,
+ "qualified name does not name a class");
+ return error_mark_node;
+ }
else if (nested_name_specifier)
{
tree scope;