diff options
author | Jason Merrill <jason@redhat.com> | 2013-03-17 23:41:10 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-03-17 23:41:10 -0400 |
commit | 136357ac8d1da764c452aa4316ebf8ea7e027457 (patch) | |
tree | a0f31b0426ec1dafc086760b32d08ebadabace05 /gcc/cp | |
parent | d0d475ef301efce45418a65c4ab1181c5ad7772f (diff) | |
download | gcc-136357ac8d1da764c452aa4316ebf8ea7e027457.zip gcc-136357ac8d1da764c452aa4316ebf8ea7e027457.tar.gz gcc-136357ac8d1da764c452aa4316ebf8ea7e027457.tar.bz2 |
re PR c++/54359 ([C++0x] decltype in member function's trailing return type when defined outside of class)
PR c++/54359
PR c++/56639
* parser.c (cp_parser_direct_declarator): Bail if we see a
qualified-id not at namespace scope.
From-SVN: r196765
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b341e92..b2796b6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2013-03-17 Jason Merrill <jason@redhat.com> + PR c++/54359 + PR c++/56639 + * parser.c (cp_parser_direct_declarator): Bail if we see a + qualified-id not at namespace scope. + PR c++/17232 PR c++/56642 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 0222e90..23fe3f3 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16707,9 +16707,18 @@ cp_parser_direct_declarator (cp_parser* parser, handle_declarator:; scope = get_scope_of_declarator (declarator); if (scope) - /* Any names that appear after the declarator-id for a - member are looked up in the containing scope. */ - pushed_scope = push_scope (scope); + { + /* Any names that appear after the declarator-id for a + member are looked up in the containing scope. */ + if (at_function_scope_p ()) + { + /* But declarations with qualified-ids can't appear in a + function. */ + cp_parser_error (parser, "qualified-id in declaration"); + break; + } + pushed_scope = push_scope (scope); + } parser->in_declarator_p = true; if ((ctor_dtor_or_conv_p && *ctor_dtor_or_conv_p) || (declarator && declarator->kind == cdk_id)) |