From ce6d2586b573b25174238dd7918acfc09b937d7e Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 6 Jun 2012 12:22:16 +0000 Subject: [PATCH] re PR c++/52841 (error: type 'Solvable' is not a base type for type 'Resolvable') 2012-06-06 Fabien Chene PR c++/52841 * parser.c (cp_parser_alias_declaration): Return earlier if an error occured. * g++.dg/cpp0x/pr52841.C: New testcase. From-SVN: r188264 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/parser.c | 3 +++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/pr52841.C | 17 +++++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr52841.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f473e2c..cd983fa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2012-06-06 Fabien Chêne + + PR c++/52841 + * parser.c (cp_parser_alias_declaration): Return earlier + if an error occured. + 2012-06-04 Paolo Carlini PR c++/53524 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 2afcbc0..5256d01 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -15061,6 +15061,9 @@ cp_parser_alias_declaration (cp_parser* 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. */ /* diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a219f84..540842b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-06-06 Fabien Chêne + + PR c++/52841 + * g++.dg/cpp0x/pr52841.C: New testcase. + 2012-06-06 Richard Guenther PR tree-optimization/53081 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr52841.C b/gcc/testsuite/g++.dg/cpp0x/pr52841.C new file mode 100644 index 0000000..f6467f8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr52841.C @@ -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; +}; -- 2.7.4