This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH to improve C++11 diagnostic on inherit/using5.C
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Cc: Dodji Seketeli <dodji at redhat dot com>
- Date: Wed, 09 Nov 2011 12:39:30 -0500
- Subject: C++ PATCH to improve C++11 diagnostic on inherit/using5.C
I've been working on improving the running of the testsuite in C++11
mode; one of the failures it found was an odd error on
g++.dg/inherit/using5.C due to the compiler trying to parse 'using B::f'
as an alias-declaration. Fixed by bailing out early if parsing fails.
Tested x86_64-pc-linux-gnu, applying to trunk.
commit a918a6931a1badcf8496d70041b1b3bf1e682cc3
Author: Jason Merrill <jason@redhat.com>
Date: Tue Nov 8 20:18:35 2011 -0500
* parser.c (cp_parser_alias_declaration): Don't do semantic
processing if parsing failed.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 1376a3a..9034344 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -14944,6 +14944,9 @@ cp_parser_alias_declaration (cp_parser* parser)
type = cp_parser_type_id (parser);
cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
+ if (cp_parser_error_occurred (parser))
+ return error_mark_node;
+
/* A typedef-name can also be introduced by an alias-declaration. The
identifier following the using keyword becomes a typedef-name. It has
the same semantics as if it were introduced by the typedef