summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPMacroExpansion.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-30 18:55:52 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-30 18:55:52 +0000
commit8c8684bbe1113ee5c852560e89f7104af744e460 (patch)
tree163dbb90a47a7ab73d32e259ffd25b49480edd80 /clang/lib/Lex/PPMacroExpansion.cpp
parent4cf4f8a5d482fa03c712cad493b39057ff93b6ab (diff)
downloadbcm5719-llvm-8c8684bbe1113ee5c852560e89f7104af744e460.tar.gz
bcm5719-llvm-8c8684bbe1113ee5c852560e89f7104af744e460.zip
[preprocessor] Don't warn about "disabled expansion of recursive macro"
for "#define X X". This is a pattern that, for example, stdbool.h uses. rdar://12435773 llvm-svn: 173952
Diffstat (limited to 'clang/lib/Lex/PPMacroExpansion.cpp')
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 63791448858..939c4faf7a0 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -459,7 +459,10 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
if (MacroInfo *NewMI = getMacroInfo(NewII))
if (!NewMI->isEnabled() || NewMI == MI) {
Identifier.setFlag(Token::DisableExpand);
- Diag(Identifier, diag::pp_disabled_macro_expansion);
+ // Don't warn for "#define X X" like "#define bool bool" from
+ // stdbool.h.
+ if (NewMI != MI)
+ Diag(Identifier, diag::pp_disabled_macro_expansion);
}
}
OpenPOWER on IntegriCloud