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 | 847f3ca350aa925158b133e2c67dc37b0816195a (patch) | |
tree | a1b86c64ab4791670c3d942cfdad95411dfefcc3 /clang/lib/Lex/PPExpressions.cpp | |
parent | fc9420c0061f3aa5d4d410d2d38ea627cc2537bd (diff) | |
download | bcm5719-llvm-847f3ca350aa925158b133e2c67dc37b0816195a.tar.gz bcm5719-llvm-847f3ca350aa925158b133e2c67dc37b0816195a.zip |
The keywords "true" and "false" shouldn't warn under -Wundef.
llvm-svn: 164279
Diffstat (limited to 'clang/lib/Lex/PPExpressions.cpp')
-rw-r--r-- | clang/lib/Lex/PPExpressions.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp index 7cac63eb0f5..49dfa198f63 100644 --- a/clang/lib/Lex/PPExpressions.cpp +++ b/clang/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. |