summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo.bagnara@gmail.com>2012-01-01 22:01:04 +0000
committerAbramo Bagnara <abramo.bagnara@gmail.com>2012-01-01 22:01:04 +0000
commit123bec89ab8fd59364adcd9fea8d5b11791c6310 (patch)
treedc8789db0bab6c2a87c8f9fa6d0fdffbffaefd6f /clang/lib/Lex/Preprocessor.cpp
parentda38930cf37c38870e9776f15dbe32b3192ff970 (diff)
downloadbcm5719-llvm-123bec89ab8fd59364adcd9fea8d5b11791c6310.tar.gz
bcm5719-llvm-123bec89ab8fd59364adcd9fea8d5b11791c6310.zip
Added -Wdisabled-macro-expansion warning.
llvm-svn: 147418
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index dea7efc7658..90b67984665 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -509,8 +509,10 @@ void Preprocessor::HandleIdentifier(Token &Identifier) {
// If this is a macro to be expanded, do it.
if (MacroInfo *MI = getMacroInfo(&II)) {
- if (!DisableMacroExpansion && !Identifier.isExpandDisabled()) {
- if (MI->isEnabled()) {
+ if (!DisableMacroExpansion) {
+ if (Identifier.isExpandDisabled()) {
+ Diag(Identifier, diag::pp_disabled_macro_expansion);
+ } else if (MI->isEnabled()) {
if (!HandleMacroExpandedIdentifier(Identifier, MI))
return;
} else {
@@ -518,6 +520,7 @@ void Preprocessor::HandleIdentifier(Token &Identifier) {
// expanded, even if it's in a context where it could be expanded in the
// future.
Identifier.setFlag(Token::DisableExpand);
+ Diag(Identifier, diag::pp_disabled_macro_expansion);
}
}
}
OpenPOWER on IntegriCloud