diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2011-02-03 17:16:17 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2011-02-03 17:16:17 +0000 |
commit | ba9e6dd56cd07311fce012f4cfe2c74007d7ffcd (patch) | |
tree | 3037e42c4d4fe6047d9ad5d3c4f084f3e0c0dc39 /gcc/cp/parser.c | |
parent | 4ba67a06590810f6ecbe55cc69c94634fc71ddbb (diff) | |
download | gcc-ba9e6dd56cd07311fce012f4cfe2c74007d7ffcd.zip gcc-ba9e6dd56cd07311fce012f4cfe2c74007d7ffcd.tar.gz gcc-ba9e6dd56cd07311fce012f4cfe2c74007d7ffcd.tar.bz2 |
re PR c++/46890 (Failed to compile scummvm's player_v4a.cpp)
gcc/c-family/
PR c++/46890
* c-common.h (keyword_is_decl_specifier): Declare.
* c-common.c (keyword_is_decl_specifier): Define.
(keyword_is_function_specifier): New function.
gcc/cp/
PR c++/46890
* parser.c (cp_parser_class_specifier): Fix setting of
want_semicolon.
gcc/testsuite/
PR c++/46890
* g++.dg/parser/semicolon3.C: Adjust.
* g++.dg/parser/semicolon4.C: New testcase.
* g++.dg/pr46890.C: New testcase.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r169797
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 2b6a752..11039b8 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16998,18 +16998,15 @@ cp_parser_class_specifier (cp_parser* parser) class Z { } static const <type> var = ...; */ case CPP_KEYWORD: - if (keyword_is_storage_class_specifier (token->keyword) - || keyword_is_type_qualifier (token->keyword)) + if (keyword_is_decl_specifier (token->keyword)) { cp_token *lookahead = cp_lexer_peek_nth_token (parser->lexer, 2); - if (lookahead->type == CPP_KEYWORD - && !keyword_begins_type_specifier (lookahead->keyword)) - want_semicolon = false; - else if (lookahead->type == CPP_NAME) - /* Handling user-defined types here would be nice, but - very tricky. */ - want_semicolon = false; + /* Handling user-defined types here would be nice, but very + tricky. */ + want_semicolon + = (lookahead->type == CPP_KEYWORD + && keyword_begins_type_specifier (lookahead->keyword)); } break; default: |