summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-12 19:38:02 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-12 19:38:02 +0000
commit71b7ff50ab3f3ab026c88447e79f03d939a48cfb (patch)
treef5ba16fa5d24529bdc3f1e9c02895e3b3e7ea501 /gcc/cp
parentf9ebe19f31d6d6e404bce2bbd133a76575e041fa (diff)
downloadgcc-71b7ff50ab3f3ab026c88447e79f03d939a48cfb.tar.gz
/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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139034 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/parser.c14
2 files changed, 17 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5763e3f3b48..00b3613802d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c++/12242
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 1bb52e5e01c..fd4e1bbbe7b 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;