Re-fix r129481 and r129465 properly. Nulls fixits shouldn't be dropped in
DiagnosticBuilder::AddFixItHint: they will be dropped along with any
other (possibly valid) fixits later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129495 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 8ccb9b8..b3aaaa2 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -10092,12 +10092,10 @@
<< FixItHint::CreateReplacement(Loc, "==");
SourceLocation Open = E->getSourceRange().getBegin();
- SourceLocation Close = E->getSourceRange().getEnd();
- SourceLocation LocForEndOfToken =
- Close.isMacroID() ? Close : PP.getLocForEndOfToken(Close);
+ SourceLocation Close = PP.getLocForEndOfToken(E->getSourceRange().getEnd());
Diag(Loc, diag::note_condition_assign_silence)
<< FixItHint::CreateInsertion(Open, "(")
- << FixItHint::CreateInsertion(LocForEndOfToken, ")");
+ << FixItHint::CreateInsertion(Close, ")");
}
/// \brief Redundant parentheses over an equality comparison can indicate