aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPExpressions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-18 21:18:58 +0000
committerChris Lattner <sabre@nondot.org>2009-01-18 21:18:58 +0000
commit4d2d04e9fb136e5f9530f4aa298f31e4c40c5ada (patch)
treea65934c2df7d09107cd805e5eb99d7929aab1ce4 /lib/Lex/PPExpressions.cpp
parent460b0ac80382fa73337d21dd052c1f18b27435d8 (diff)
fix rdar://6505352 - Bogus warning with -WUndef, a case
Anders noticed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62472 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPExpressions.cpp')
-rw-r--r--lib/Lex/PPExpressions.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp
index 168c9d08ad..86f93e407a 100644
--- a/lib/Lex/PPExpressions.cpp
+++ b/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());