[ExprConstant] Handle compound assignment when LHS has integral type and RHS has floating point type
Fixes PR39858
Differential Revision: https://reviews.llvm.org/D55413
llvm-svn: 349444
diff --git a/clang/test/SemaCXX/constant-expression-cxx1y.cpp b/clang/test/SemaCXX/constant-expression-cxx1y.cpp
index a71dbc0..3c57ac5 100644
--- a/clang/test/SemaCXX/constant-expression-cxx1y.cpp
+++ b/clang/test/SemaCXX/constant-expression-cxx1y.cpp
@@ -356,6 +356,14 @@
if (a != 13) return false;
a &= 14;
if (a != 12) return false;
+ a += -1.2;
+ if (a != 10) return false;
+ a -= 3.1;
+ if (a != 6) return false;
+ a *= 2.2;
+ if (a != 13) return false;
+ if (&(a /= 1.5) != &a) return false;
+ if (a != 8) return false;
return true;
}
static_assert(test_int(), "");