summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-11 20:39:47 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-11 20:39:47 +0000
commit2299889f87978b8b09e5c8f2d554143f8892c45b (patch)
treed314ee9ab324d8e2f0d589c9ae14a15b357c2d32 /clang/lib/Lex/PPDirectives.cpp
parenta59dbea0174e7dff8c062e4950e2a83c7c2b8478 (diff)
downloadbcm5719-llvm-2299889f87978b8b09e5c8f2d554143f8892c45b.tar.gz
bcm5719-llvm-2299889f87978b8b09e5c8f2d554143f8892c45b.zip
Don't warn for unused macro when undef'ing it, if it comes from an included file. rdar://9745065
llvm-svn: 134919
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index f74aad3c816..efa188f7529 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -1594,7 +1594,7 @@ void Preprocessor::HandleUndefDirective(Token &UndefTok) {
// If the macro is not defined, this is a noop undef, just return.
if (MI == 0) return;
- if (!MI->isUsed())
+ if (!MI->isUsed() && MI->isWarnIfUnused())
Diag(MI->getDefinitionLoc(), diag::pp_macro_not_used);
// If the callbacks want to know, tell them about the macro #undef.
OpenPOWER on IntegriCloud