diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-18 21:18:58 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-18 21:18:58 +0000 |
| commit | fc014f80e51f1804d8224b21adf8b420e4106135 (patch) | |
| tree | d371823942b28599eb6e5a4a094b0a721bfa711c /clang/lib | |
| parent | 64b7bd7f9e1d1965d90d20f4324c0c6ea66726e6 (diff) | |
| download | bcm5719-llvm-fc014f80e51f1804d8224b21adf8b420e4106135.tar.gz bcm5719-llvm-fc014f80e51f1804d8224b21adf8b420e4106135.zip | |
fix rdar://6505352 - Bogus warning with -WUndef, a case
Anders noticed.
llvm-svn: 62472
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Lex/PPExpressions.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp index 168c9d08adf..86f93e407a4 100644 --- a/clang/lib/Lex/PPExpressions.cpp +++ b/clang/lib/Lex/PPExpressions.cpp @@ -91,7 +91,8 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT, // into a simple 0, unless it is the C++ keyword "true", in which case it // turns into "1". if (II->getPPKeywordID() != tok::pp_defined) { - PP.Diag(PeekTok, diag::warn_pp_undef_identifier) << II; + if (ValueLive) + 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. Result.setRange(PeekTok.getLocation()); |

