forked from OSchip/llvm-project
Parse: Handle __declspec in a lambda definition
llvm-svn: 228121
This commit is contained in:
parent
631a90b6bc
commit
bda8632f9b
|
@ -1085,6 +1085,11 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
|
|||
// compatible with GCC.
|
||||
MaybeParseGNUAttributes(Attr, &DeclEndLoc);
|
||||
|
||||
// MSVC-style attributes must be parsed before the mutable specifier to be
|
||||
// compatible with MSVC.
|
||||
while (Tok.is(tok::kw___declspec))
|
||||
ParseMicrosoftDeclSpec(Attr);
|
||||
|
||||
// Parse 'mutable'[opt].
|
||||
SourceLocation MutableLoc;
|
||||
if (TryConsumeToken(tok::kw_mutable, MutableLoc))
|
||||
|
|
|
@ -4,3 +4,4 @@ struct __declspec(novtable) S {};
|
|||
enum __declspec(novtable) E {}; // expected-warning{{'novtable' attribute only applies to classes}}
|
||||
int __declspec(novtable) I; // expected-warning{{'novtable' attribute only applies to classes}}
|
||||
typedef struct T __declspec(novtable) U; // expected-warning{{'novtable' attribute only applies to classes}}
|
||||
auto z = []() __declspec(novtable) { return nullptr; }; // expected-warning{{'novtable' attribute only applies to classes}}
|
||||
|
|
Loading…
Reference in New Issue