From b9aff1edb38c43c57650dd7236dd10a659aa970f Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Fri, 24 May 2013 18:32:55 +0000 Subject: [ms-inline asm] Don't diagnose an empty lookup for inline assmebly. This happen for labels in inline assembly that aren't in the lookup tables. E.g., __asm { a: jmp a } rdar://13983623 llvm-svn: 182659 --- clang/lib/Sema/SemaExpr.cpp | 7 ++++++- clang/lib/Sema/SemaStmtAsm.cpp | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 9d6601af328..a70e3917214 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -1821,7 +1821,8 @@ ExprResult Sema::ActOnIdExpression(Scope *S, UnqualifiedId &Id, bool HasTrailingLParen, bool IsAddressOfOperand, - CorrectionCandidateCallback *CCC) { + CorrectionCandidateCallback *CCC, + bool IsInlineAsmIdentifier) { assert(!(IsAddressOfOperand && HasTrailingLParen) && "cannot be direct & operand and have a trailing lparen"); @@ -1937,6 +1938,10 @@ ExprResult Sema::ActOnIdExpression(Scope *S, IsAddressOfOperand, TemplateArgs); } + // Don't diagnose an empty lookup for inline assmebly. + if (IsInlineAsmIdentifier) + return ExprError(); + CorrectionCandidateCallback DefaultValidator; if (DiagnoseEmptyLookup(S, SS, R, CCC ? *CCC : DefaultValidator)) return ExprError(); diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp index 1b874762194..9169032178f 100644 --- a/clang/lib/Sema/SemaStmtAsm.cpp +++ b/clang/lib/Sema/SemaStmtAsm.cpp @@ -381,7 +381,9 @@ ExprResult Sema::LookupInlineAsmIdentifier(CXXScopeSpec &SS, ExprResult Result = ActOnIdExpression(getCurScope(), SS, TemplateKWLoc, Id, /*trailing lparen*/ false, - /*is & operand*/ false); + /*is & operand*/ false, + /*CorrectionCandidateCallback=*/0, + /*IsInlineAsmIdentifier=*/ true); if (IsUnevaluatedContext) PopExpressionEvaluationContext(); -- cgit v1.2.3