summaryrefslogtreecommitdiff
path: root/clang/lib/Lex/PPExpressions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/PPExpressions.cpp')
-rw-r--r--clang/lib/Lex/PPExpressions.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp
index cab4bab630dc..424cccfdb9ee 100644
--- a/clang/lib/Lex/PPExpressions.cpp
+++ b/clang/lib/Lex/PPExpressions.cpp
@@ -133,6 +133,8 @@ static bool EvaluateDefined(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
Result.Val.setIsUnsigned(false); // Result is signed intmax_t.
DT.IncludedUndefinedIds = !Macro;
+ PP.emitMacroExpansionWarnings(PeekTok);
+
// If there is a macro, mark it used.
if (Result.Val != 0 && ValueLive)
PP.markMacroAsUsed(Macro.getMacroInfo());
@@ -660,7 +662,7 @@ static bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec,
case tok::ampamp: // Logical && does not do UACs.
break; // No UAC
default:
- Res.setIsUnsigned(LHS.isUnsigned()|RHS.isUnsigned());
+ Res.setIsUnsigned(LHS.isUnsigned() || RHS.isUnsigned());
// If this just promoted something from signed to unsigned, and if the
// value was negative, warn about it.
if (ValueLive && Res.isUnsigned()) {
@@ -820,7 +822,7 @@ static bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec,
// Usual arithmetic conversions (C99 6.3.1.8p1): result is unsigned if
// either operand is unsigned.
- Res.setIsUnsigned(RHS.isUnsigned() | AfterColonVal.isUnsigned());
+ Res.setIsUnsigned(RHS.isUnsigned() || AfterColonVal.isUnsigned());
// Figure out the precedence of the token after the : part.
PeekPrec = getPrecedence(PeekTok.getKind());