diff options
Diffstat (limited to 'clang/Lex/PPExpressions.cpp')
-rw-r--r-- | clang/Lex/PPExpressions.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/Lex/PPExpressions.cpp b/clang/Lex/PPExpressions.cpp index 3217df9fc9e..9ed59d5b13a 100644 --- a/clang/Lex/PPExpressions.cpp +++ b/clang/Lex/PPExpressions.cpp @@ -106,6 +106,13 @@ static bool EvaluateValue(int &Result, LexerToken &PeekTok, DefinedTracker &DT, PP.getTargetInfo().DiagnoseNonPortability(PeekTok.getLocation(), diag::port_target_macro_use); } + } else { + // Use of a target-specific macro for some other target? If so, warn. + if (II->isOtherTargetMacro()) { + II->setIsOtherTargetMacro(false); // Don't warn on second use. + PP.getTargetInfo().DiagnoseNonPortability(PeekTok.getLocation(), + diag::port_target_macro_use); + } } // Consume identifier. |