diff options
Diffstat (limited to 'clang/lib/Parse/ParseStmtAsm.cpp')
-rw-r--r-- | clang/lib/Parse/ParseStmtAsm.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/clang/lib/Parse/ParseStmtAsm.cpp b/clang/lib/Parse/ParseStmtAsm.cpp index d3281393f92..f469a064f89 100644 --- a/clang/lib/Parse/ParseStmtAsm.cpp +++ b/clang/lib/Parse/ParseStmtAsm.cpp @@ -215,17 +215,22 @@ ExprResult Parser::ParseMSAsmIdentifier(llvm::SmallVectorImpl<Token> &LineToks, // Require an identifier here. SourceLocation TemplateKWLoc; UnqualifiedId Id; - bool Invalid = - ParseUnqualifiedId(SS, - /*EnteringContext=*/false, - /*AllowDestructorName=*/false, - /*AllowConstructorName=*/false, - /*ObjectType=*/ParsedType(), TemplateKWLoc, Id); - - // Perform the lookup. - ExprResult Result = Actions.LookupInlineAsmIdentifier( - SS, TemplateKWLoc, Id, Info, IsUnevaluatedContext); - + bool Invalid = true; + ExprResult Result; + if (Tok.is(tok::kw_this)) { + Result = ParseCXXThis(); + Invalid = false; + } else { + Invalid = + ParseUnqualifiedId(SS, + /*EnteringContext=*/false, + /*AllowDestructorName=*/false, + /*AllowConstructorName=*/false, + /*ObjectType=*/ParsedType(), TemplateKWLoc, Id); + // Perform the lookup. + Result = Actions.LookupInlineAsmIdentifier(SS, TemplateKWLoc, Id, Info, + IsUnevaluatedContext); + } // While the next two tokens are 'period' 'identifier', repeatedly parse it as // a field access. We have to avoid consuming assembler directives that look // like '.' 'else'. |