diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-11-02 07:53:53 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-11-02 07:53:53 +0100 |
commit | 628be4ef7078d5fcbd0096f7b11fb9a24e4da08a (patch) | |
tree | f86c1070852444331f12cbca2368507e6e82a875 /gcc/cp/parser.c | |
parent | 1afe39ac14274d1ce4ffdf9f80833c53175e8581 (diff) | |
download | gcc-628be4ef7078d5fcbd0096f7b11fb9a24e4da08a.zip gcc-628be4ef7078d5fcbd0096f7b11fb9a24e4da08a.tar.gz gcc-628be4ef7078d5fcbd0096f7b11fb9a24e4da08a.tar.bz2 |
re PR c++/89640 (g++ chokes on lambda with __attribute__)
PR c++/89640
* parser.c (cp_parser_decl_specifier_seq): Don't parse attributes
if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
* g++.dg/cpp1z/attr-lambda1.C: New test.
* g++.dg/ext/attr-lambda2.C: New test.
From-SVN: r277741
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 516c14b..3ed282f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -13994,7 +13994,8 @@ cp_parser_decl_specifier_seq (cp_parser* parser, if (!start_token) start_token = token; /* Handle attributes. */ - if (cp_next_tokens_can_be_attribute_p (parser)) + if ((flags & CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR) == 0 + && cp_next_tokens_can_be_attribute_p (parser)) { /* Parse the attributes. */ tree attrs = cp_parser_attributes_opt (parser); |