aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 15751d078b..42ec82ac4a 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -8963,7 +8963,10 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
QualType LeftType = lhs.get()->getType();
QualType RightType = rhs.get()->getType();
if (LeftNull != RightNull &&
- !LeftType->isPointerLikeType() && !RightType->isPointerLikeType()) {
+ !LeftType->isPointerLikeType() &&
+ !LeftType->canDecayToPointerType() &&
+ !RightType->isPointerLikeType() &&
+ !RightType->canDecayToPointerType()) {
Diag(OpLoc, diag::warn_null_in_arithmetic_operation)
<< (LeftNull ? lhs.get()->getSourceRange()
: rhs.get()->getSourceRange());