diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-01-30 23:10:17 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-01-30 23:10:17 +0000 |
commit | 40f56e5b677761c8258324222d62fce3e4f6bca4 (patch) | |
tree | e1cf204cb1fe582883612bc356bb25f4c9986ee5 /lib | |
parent | 91165e74c8b480c1da3a719d764f4fa0e7b1b921 (diff) |
Reinstate r173952, this time limiting it to exactly the form
#define X X
for which there is no point warning, ever.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 6379144885..bda31ed294 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/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 || MI->isFunctionLike()) + Diag(Identifier, diag::pp_disabled_macro_expansion); } } |