aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-04-14 00:51:41 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-04-14 00:51:41 +0000
commitdde5557e87e1163ad792471e0bdbb2cd17894576 (patch)
treef2d8cbac0f64d3d0243c044b8ededaaa9fd24218 /lib
parent0d8dc460ae02e29d0b2abb4d6d093736e2f920ea (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExpr.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 8ccb9b8180..b3aaaa2e9e 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -10092,12 +10092,10 @@ void Sema::DiagnoseAssignmentAsCondition(Expr *E) {
<< 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