summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-30 23:10:17 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-30 23:10:17 +0000
commit1a347f76c2d93a8d92cf8031c802d876d72cb637 (patch)
tree3bdd3e53aec367217e241b9197ace7edc87b2fc1 /clang/lib/Lex
parentd219675c2a8d5acc0bb77752cf242a7af0f97fe0 (diff)
downloadbcm5719-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.cpp5
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);
}
}
OpenPOWER on IntegriCloud