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 | 1a347f76c2d93a8d92cf8031c802d876d72cb637 (patch) | |
| tree | 3bdd3e53aec367217e241b9197ace7edc87b2fc1 /clang/lib/Lex | |
| parent | d219675c2a8d5acc0bb77752cf242a7af0f97fe0 (diff) | |
| download | bcm5719-llvm-1a347f76c2d93a8d92cf8031c802d876d72cb637.tar.gz bcm5719-llvm-1a347f76c2d93a8d92cf8031c802d876d72cb637.zip | |
Reinstate r173952, this time limiting it to exactly the form
#define X X
for which there is no point warning, ever.
llvm-svn: 173991
Diffstat (limited to 'clang/lib/Lex')
| -rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 63791448858..bda31ed294a 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 || MI->isFunctionLike()) + Diag(Identifier, diag::pp_disabled_macro_expansion); } } |

