diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-04-13 22:18:37 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-04-13 22:18:37 +0000 |
commit | 6027461b6c4d1567a8d7533ad97ccf81bd2b9500 (patch) | |
tree | e3cce2092b6702b4ac673304bcea44ff7bcf5e07 /lib/Sema/SemaExpr.cpp | |
parent | 5ca328fed2c7bcdf5f1cc1f53d9dc4b9edc95671 (diff) |
Issue the 2nd fixit even if fix-it hint is supressed.
// rdar://9091893
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 3d2b14933e..ac1128b361 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -10081,12 +10081,11 @@ void Sema::DiagnoseAssignmentAsCondition(Expr *E) { SourceLocation Open = E->getSourceRange().getBegin(); SourceLocation Close = E->getSourceRange().getEnd(); - if (!Open.isMacroID() && !Close.isMacroID()) { - SourceLocation LocForEndOfToken = PP.getLocForEndOfToken(Close); - Diag(Loc, diag::note_condition_assign_silence) - << FixItHint::CreateInsertion(Open, "(") - << FixItHint::CreateInsertion(LocForEndOfToken, ")"); - } + SourceLocation LocForEndOfToken = + Close.isMacroID() ? Close : PP.getLocForEndOfToken(Close); + Diag(Loc, diag::note_condition_assign_silence) + << FixItHint::CreateInsertion(Open, "(") + << FixItHint::CreateInsertion(LocForEndOfToken, ")"); } /// \brief Redundant parentheses over an equality comparison can indicate |