diff options
author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2012-01-01 22:01:04 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2012-01-01 22:01:04 +0000 |
commit | 123bec89ab8fd59364adcd9fea8d5b11791c6310 (patch) | |
tree | dc8789db0bab6c2a87c8f9fa6d0fdffbffaefd6f /clang/lib/Lex/Preprocessor.cpp | |
parent | da38930cf37c38870e9776f15dbe32b3192ff970 (diff) | |
download | bcm5719-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.cpp | 7 |
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); } } } |