diff --git a/src/Magnum/Math/Test/BezierTest.cpp b/src/Magnum/Math/Test/BezierTest.cpp index 488781b56..875c7b3a4 100644 --- a/src/Magnum/Math/Test/BezierTest.cpp +++ b/src/Magnum/Math/Test/BezierTest.cpp @@ -209,7 +209,12 @@ void BezierTest::convert() { constexpr QuadraticBezier2D c{a}; CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = QBezier2D(b); + #else constexpr QBezier2D d(b); + #endif CORRADE_COMPARE(d.x0, a.x0); CORRADE_COMPARE(d.x1, a.x1); CORRADE_COMPARE(d.y0, a.y0); diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index 378635ba0..c50bbef06 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -455,7 +455,12 @@ void ColorTest::convert() { Color3 c3(a3); CORRADE_COMPARE(c3, b3); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d3 = Vec3(b3); + #else constexpr Vec3 d3(b3); + #endif CORRADE_COMPARE(d3.x, a3.x); CORRADE_COMPARE(d3.y, a3.y); CORRADE_COMPARE(d3.z, a3.z); @@ -469,7 +474,12 @@ void ColorTest::convert() { Color4 c4(a4); CORRADE_COMPARE(c4, b4); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d4 = Vec4(b4); + #else constexpr Vec4 d4(b4); + #endif CORRADE_COMPARE(d4.x, a4.x); CORRADE_COMPARE(d4.y, a4.y); CORRADE_COMPARE(d4.z, a4.z); diff --git a/src/Magnum/Math/Test/ComplexTest.cpp b/src/Magnum/Math/Test/ComplexTest.cpp index b0a3095bd..a41b1ec47 100644 --- a/src/Magnum/Math/Test/ComplexTest.cpp +++ b/src/Magnum/Math/Test/ComplexTest.cpp @@ -274,7 +274,12 @@ void ComplexTest::convert() { constexpr Complex c(a); CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Cmpl(b); + #else constexpr Cmpl d(b); + #endif CORRADE_COMPARE(d.re, a.re); CORRADE_COMPARE(d.im, a.im); diff --git a/src/Magnum/Math/Test/DualComplexTest.cpp b/src/Magnum/Math/Test/DualComplexTest.cpp index 2bf63608a..36884ef8b 100644 --- a/src/Magnum/Math/Test/DualComplexTest.cpp +++ b/src/Magnum/Math/Test/DualComplexTest.cpp @@ -267,7 +267,12 @@ void DualComplexTest::convert() { constexpr DualComplex c{a}; CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = DualCmpl(b); + #else constexpr DualCmpl d(b); + #endif CORRADE_COMPARE(d.re, a.re); CORRADE_COMPARE(d.im, a.im); CORRADE_COMPARE(d.x, a.x); diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index e8dc87d66..381cd8d01 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/src/Magnum/Math/Test/DualQuaternionTest.cpp @@ -296,7 +296,12 @@ void DualQuaternionTest::convert() { constexpr DualQuaternion c{a}; CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = DualQuat(b); + #else constexpr DualQuat d(b); + #endif CORRADE_COMPARE(d.re.x, a.re.x); CORRADE_COMPARE(d.re.y, a.re.y); CORRADE_COMPARE(d.re.z, a.re.z); diff --git a/src/Magnum/Math/Test/FrustumTest.cpp b/src/Magnum/Math/Test/FrustumTest.cpp index 950cacc38..334da7eee 100644 --- a/src/Magnum/Math/Test/FrustumTest.cpp +++ b/src/Magnum/Math/Test/FrustumTest.cpp @@ -298,7 +298,12 @@ void FrustumTest::convert() { constexpr Frustum c{a}; CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Frstm(b); + #else constexpr Frstm d(b); + #endif CORRADE_COMPARE_AS(Corrade::Containers::arrayView(d.data), Corrade::Containers::arrayView(a.data), Corrade::TestSuite::Compare::Container); diff --git a/src/Magnum/Math/Test/Matrix3Test.cpp b/src/Magnum/Math/Test/Matrix3Test.cpp index 63584fd4f..1ab0edc1e 100644 --- a/src/Magnum/Math/Test/Matrix3Test.cpp +++ b/src/Magnum/Math/Test/Matrix3Test.cpp @@ -313,10 +313,15 @@ void Matrix3Test::convert() { constexpr Matrix3 c(b); CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Mat3(b); + #else #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ constexpr #endif Mat3 d(b); + #endif for(std::size_t i = 0; i != 9; ++i) CORRADE_COMPARE(d.a[0], a.a[0]); diff --git a/src/Magnum/Math/Test/Matrix4Test.cpp b/src/Magnum/Math/Test/Matrix4Test.cpp index 47bff862f..fa37a6a78 100644 --- a/src/Magnum/Math/Test/Matrix4Test.cpp +++ b/src/Magnum/Math/Test/Matrix4Test.cpp @@ -369,10 +369,15 @@ void Matrix4Test::convert() { constexpr Matrix4 c(b); CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Mat4(b); + #else #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why can't be conversion constexpr? */ constexpr #endif Mat4 d(b); + #endif for(std::size_t i = 0; i != 16; ++i) CORRADE_COMPARE(d.a[i], a.a[i]); diff --git a/src/Magnum/Math/Test/MatrixTest.cpp b/src/Magnum/Math/Test/MatrixTest.cpp index 9ea8c89bd..33592e71d 100644 --- a/src/Magnum/Math/Test/MatrixTest.cpp +++ b/src/Magnum/Math/Test/MatrixTest.cpp @@ -311,7 +311,12 @@ void MatrixTest::convert() { constexpr Matrix3x3 c(b); CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Mat3(b); + #else constexpr Mat3 d(b); + #endif for(std::size_t i = 0; i != 9; ++i) CORRADE_COMPARE(d.a[i], a.a[i]); diff --git a/src/Magnum/Math/Test/QuaternionTest.cpp b/src/Magnum/Math/Test/QuaternionTest.cpp index d3d8ccb82..0b931645b 100644 --- a/src/Magnum/Math/Test/QuaternionTest.cpp +++ b/src/Magnum/Math/Test/QuaternionTest.cpp @@ -311,7 +311,12 @@ void QuaternionTest::convert() { constexpr Quaternion c{a}; CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Quat(b); + #else constexpr Quat d(b); + #endif CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.z, a.z); diff --git a/src/Magnum/Math/Test/RangeTest.cpp b/src/Magnum/Math/Test/RangeTest.cpp index f2c953f46..2fb37a4bf 100644 --- a/src/Magnum/Math/Test/RangeTest.cpp +++ b/src/Magnum/Math/Test/RangeTest.cpp @@ -398,17 +398,32 @@ void RangeTest::convert() { CORRADE_COMPARE(i, e); CORRADE_COMPARE(j, f); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto k = Dim(d); + #else constexpr Dim k(d); + #endif CORRADE_COMPARE(k.offset, a.offset); CORRADE_COMPARE(k.size, a.size); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto l = Rect(e); + #else constexpr Rect l(e); + #endif CORRADE_COMPARE(l.x, b.x); CORRADE_COMPARE(l.y, b.y); CORRADE_COMPARE(l.w, b.w); CORRADE_COMPARE(l.h, b.h); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto m = Box(f); + #else constexpr Box m(f); + #endif CORRADE_COMPARE(m.x, c.x); CORRADE_COMPARE(m.y, c.y); CORRADE_COMPARE(m.z, c.z); diff --git a/src/Magnum/Math/Test/RectangularMatrixTest.cpp b/src/Magnum/Math/Test/RectangularMatrixTest.cpp index d830f159f..915330d08 100644 --- a/src/Magnum/Math/Test/RectangularMatrixTest.cpp +++ b/src/Magnum/Math/Test/RectangularMatrixTest.cpp @@ -392,7 +392,12 @@ void RectangularMatrixTest::convert() { constexpr Matrix2x3 c{a}; CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Mat2x3(b); + #else constexpr Mat2x3 d(b); + #endif for(std::size_t i = 0; i != 5; ++i) CORRADE_COMPARE(d.a[i], a.a[i]); diff --git a/src/Magnum/Math/Test/Vector2Test.cpp b/src/Magnum/Math/Test/Vector2Test.cpp index f6215c334..13b7fd19d 100644 --- a/src/Magnum/Math/Test/Vector2Test.cpp +++ b/src/Magnum/Math/Test/Vector2Test.cpp @@ -187,7 +187,12 @@ void Vector2Test::convert() { constexpr Vector2 c(a); CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Vec2(b); + #else constexpr Vec2 d(b); + #endif CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); diff --git a/src/Magnum/Math/Test/Vector3Test.cpp b/src/Magnum/Math/Test/Vector3Test.cpp index 11f132629..152df7301 100644 --- a/src/Magnum/Math/Test/Vector3Test.cpp +++ b/src/Magnum/Math/Test/Vector3Test.cpp @@ -195,7 +195,12 @@ void Vector3Test::convert() { constexpr Vector3 c(a); CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Vec3(b); + #else constexpr Vec3 d(b); + #endif CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.z, a.z); diff --git a/src/Magnum/Math/Test/Vector4Test.cpp b/src/Magnum/Math/Test/Vector4Test.cpp index c4c0d7c79..8a60ae12b 100644 --- a/src/Magnum/Math/Test/Vector4Test.cpp +++ b/src/Magnum/Math/Test/Vector4Test.cpp @@ -216,7 +216,12 @@ void Vector4Test::convert() { constexpr Vector4 c(a); CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Vec4(b); + #else constexpr Vec4 d(b); + #endif CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.z, a.z); diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index 64ea4db73..34411ac9e 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -314,7 +314,12 @@ void VectorTest::convert() { constexpr Vector3 c{a}; CORRADE_COMPARE(c, b); + /* https://developercommunity.visualstudio.com/t/MSVC-1933-fails-to-compile-valid-code-u/10185268 */ + #if defined(CORRADE_TARGET_MSVC) && CORRADE_CXX_STANDARD >= 202002L + constexpr auto d = Vec3(b); + #else constexpr Vec3 d(b); + #endif CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.z, a.z);