From 5cc85355960d8f15ce93076a928a484615e35efc Mon Sep 17 00:00:00 2001 From: Kaelyn Takata Date: Fri, 10 Apr 2015 19:16:46 +0000 Subject: Don't eagerly typo-correct to a keyword if the next token is a right paren. Take advantage of the delayed typo no longer being eagerly corrected to a keyword to filter out keyword corrections (and other things like unresolved & overloaded expressions, which have placeholder types) when correcting typos inside of a decltype(). llvm-svn: 234623 --- clang/lib/Parse/ParseExpr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Parse/ParseExpr.cpp') diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index 72af14d068f..315c9574e95 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -928,7 +928,8 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, Res = Actions.ActOnIdExpression( getCurScope(), ScopeSpec, TemplateKWLoc, Name, Tok.is(tok::l_paren), isAddressOfOperand, std::move(Validator), - /*IsInlineAsmIdentifier=*/false, &Replacement); + /*IsInlineAsmIdentifier=*/false, + Tok.is(tok::r_paren) ? nullptr : &Replacement); if (!Res.isInvalid() && !Res.get()) { UnconsumeToken(Replacement); return ParseCastExpression(isUnaryExpression, isAddressOfOperand, -- cgit v1.2.3