From bda8632f9b51b0958b242ba1b2f161cf7470d461 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Wed, 4 Feb 2015 08:22:46 +0000 Subject: Parse: Handle __declspec in a lambda definition llvm-svn: 228121 --- clang/lib/Parse/ParseExprCXX.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib') diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index 10ae450fe89..445967bfab8 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -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)) -- cgit v1.2.3