summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-08-24 17:36:20 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-08-24 17:36:20 +0000
commitcb2d6caa93d19e64ec782d5ea04d6b1611cb2c10 (patch)
treec36cf9e995310144c8b7f877846f09e2f0c248f9 /lib/Sema/SemaExpr.cpp
parent631f6b779f4d248755ad71398d0f296653dd62cf (diff)
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 57159fb59715..adcc38cbc4fd 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -8567,7 +8567,7 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS,
// If LHS does not have a signed type and non-negative value
// then, the behavior is undefined. Warn about it.
- if (Left.isNegative()) {
+ if (Left.isNegative() && !S.getLangOpts().isSignedOverflowDefined()) {
S.DiagRuntimeBehavior(Loc, LHS.get(),
S.PDiag(diag::warn_shift_lhs_negative)
<< LHS.get()->getSourceRange());