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
13 lines
501 B
C
13 lines
501 B
C
// PR c++/89640
|
|
// { dg-options "-Wno-attributes" }
|
|
// { dg-do compile { target c++17 } }
|
|
|
|
void test() {
|
|
[]() mutable [[gnu::cold]] constexpr {}(); // { dg-error "expected" }
|
|
[]() constexpr [[gnu::cold]] mutable {}(); // { dg-error "expected" }
|
|
[]() [[gnu::cold]] mutable constexpr {}(); // { dg-error "expected" }
|
|
[]() [[gnu::cold]] constexpr mutable {}(); // { dg-error "expected" }
|
|
[]() mutable constexpr [[gnu::cold]] {}();
|
|
[]() constexpr mutable [[gnu::cold]] {}();
|
|
}
|