diff options
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index dea7efc765..90b6798466 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/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); } } } |