diff options
author | Matt Beaumont-Gay <matthewbg@google.com> | 2013-01-12 00:54:16 +0000 |
---|---|---|
committer | Matt Beaumont-Gay <matthewbg@google.com> | 2013-01-12 00:54:16 +0000 |
commit | c3cd6f7a5d33ad44f6c9cf4faa7046c77baa128e (patch) | |
tree | 79504996f06f1957050e8acb8c99e878ee0aefe0 /lib/Sema/SemaStmt.cpp | |
parent | c328d9c22a4397dd7313d06be5b82d700297b246 (diff) |
Fix -Wunused-comparison for comparisons in arguments to function-like macros.
Previously, -Wunused-comparison ignored comparisons in both macro bodies and
macro arguments, but we would still emit a -Wunused-value warning for either.
Now we correctly emit -Wunused-comparison for expressions in macro arguments.
Also, add isMacroBodyExpansion to SourceManager, to go along with
isMacroArgExpansion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index b738793ef9..a9d3dd5ad3 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -126,7 +126,7 @@ static bool DiagnoseUnusedComparison(Sema &S, const Expr *E) { // Suppress warnings when the operator, suspicious as it may be, comes from // a macro expansion. - if (Loc.isMacroID()) + if (S.SourceMgr.isMacroBodyExpansion(Loc)) return false; S.Diag(Loc, diag::warn_unused_comparison) |