summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index c084bb0a80d..ec5e3e0c3c3 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -9244,17 +9244,12 @@ void Sema::DiagnoseEqualityWithExtraParens(ParenExpr *parenE) {
== Expr::MLV_Valid) {
SourceLocation Loc = opE->getOperatorLoc();
- // Don't emit a warning if the operation occurs within a macro.
- // Sometimes extra parentheses are used within macros to make the
- // instantiation of the macro less error prone.
- if (!Loc.isMacroID()) {
- Diag(Loc, diag::warn_equality_with_extra_parens) << E->getSourceRange();
- Diag(Loc, diag::note_equality_comparison_to_assign)
- << FixItHint::CreateReplacement(Loc, "=");
- Diag(Loc, diag::note_equality_comparison_silence)
- << FixItHint::CreateRemoval(parenE->getSourceRange().getBegin())
- << FixItHint::CreateRemoval(parenE->getSourceRange().getEnd());
- }
+ Diag(Loc, diag::warn_equality_with_extra_parens) << E->getSourceRange();
+ Diag(Loc, diag::note_equality_comparison_to_assign)
+ << FixItHint::CreateReplacement(Loc, "=");
+ Diag(Loc, diag::note_equality_comparison_silence)
+ << FixItHint::CreateRemoval(parenE->getSourceRange().getBegin())
+ << FixItHint::CreateRemoval(parenE->getSourceRange().getEnd());
}
}
OpenPOWER on IntegriCloud