diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-09-20 02:38:38 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-09-20 02:38:38 +0000 |
commit | 9c611373cc25300c02043bdde2f2a3d8008704f1 (patch) | |
tree | 9946eef32fea4b5505c79cb21e30bc930596dce2 /lib/Lex/PPExpressions.cpp | |
parent | c20c7275c351f362b42915901d308ac66b8b71d1 (diff) |
The keywords "true" and "false" shouldn't warn under -Wundef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPExpressions.cpp')
-rw-r--r-- | lib/Lex/PPExpressions.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index 7cac63eb0f..49dfa198f6 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -178,7 +178,9 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT, // preprocessor keywords and it wasn't macro expanded, it turns // into a simple 0, unless it is the C++ keyword "true", in which case it // turns into "1". - if (ValueLive) + if (ValueLive && + II->getTokenID() != tok::kw_true && + II->getTokenID() != tok::kw_false) PP.Diag(PeekTok, diag::warn_pp_undef_identifier) << II; Result.Val = II->getTokenID() == tok::kw_true; Result.Val.setIsUnsigned(false); // "0" is signed intmax_t 0. |