This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][C++] Fix PR52841
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Date: Mon, 4 Jun 2012 11:52:35 +0200 (CEST)
- Subject: [PATCH][C++] Fix PR52841
We are using the following patch from Fabien in our tree to fix
a rejects-valid bug quite appearant in our own codebase.
Re-bootstrap and regtest on the branch head currently running,
ok if that succeeds?
Thanks,
Richard.
2012-06-04 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/52841
* parser.c (cp_parser_alias_declaration): Return earlier
if an error occured.
* g++.dg/cpp0x/pr52841.C: New testcase.
Index: gcc/cp/parser.c
===================================================================
--- gcc/cp/parser.c (revision 186200)
+++ gcc/cp/parser.c (working copy)
@@ -15072,6 +15072,9 @@ cp_parser_alias_declaration (cp_parser*
cp_parser_require (parser, CPP_EQ, RT_EQ);
+ if (cp_parser_error_occurred (parser))
+ return error_mark_node;
+
/* Now we are going to parse the type-id of the declaration. */
/*
Index: gcc/testsuite/g++.dg/cpp0x/pr52841.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/pr52841.C (revision 0)
+++ gcc/testsuite/g++.dg/cpp0x/pr52841.C (revision 0)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+struct Solvable;
+namespace sat
+{
+ class Solvable
+ {
+ public:
+ typedef bool bool_type;
+ };
+}
+
+class Resolvable : public sat::Solvable
+{
+public:
+ using sat::Solvable::bool_type;
+};