From 913600737179fe1cd3a449f306cfa4603fb25401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 6 Sep 2015 23:22:28 +0200 Subject: [PATCH] MSVC 2015 compatibility: apparently dereferencing pointer is verboten. --- src/Magnum/Math/Test/BoolVectorTest.cpp | 5 ++++- src/Magnum/Math/Test/RectangularMatrixTest.cpp | 5 ++++- src/Magnum/Math/Test/VectorTest.cpp | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Math/Test/BoolVectorTest.cpp b/src/Magnum/Math/Test/BoolVectorTest.cpp index 8cde1070e..8ea552829 100644 --- a/src/Magnum/Math/Test/BoolVectorTest.cpp +++ b/src/Magnum/Math/Test/BoolVectorTest.cpp @@ -143,7 +143,10 @@ void BoolVectorTest::data() { constexpr bool b = a[9]; CORRADE_COMPARE(b, true); - constexpr UnsignedByte c = *a.data(); + #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Apparently dereferencing pointer is verboten */ + constexpr + #endif + UnsignedByte c = *a.data(); CORRADE_COMPARE(c, 0x08); BoolVector19 d(0x08, 0x03, 0x04); diff --git a/src/Magnum/Math/Test/RectangularMatrixTest.cpp b/src/Magnum/Math/Test/RectangularMatrixTest.cpp index b5ff25758..d14d24da9 100644 --- a/src/Magnum/Math/Test/RectangularMatrixTest.cpp +++ b/src/Magnum/Math/Test/RectangularMatrixTest.cpp @@ -283,7 +283,10 @@ void RectangularMatrixTest::data() { #endif Vector4 b = a[2]; constexpr Float c = a[1][2]; - constexpr Float d = *a.data(); + #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Apparently dereferencing pointer is verboten */ + constexpr + #endif + Float d = *a.data(); CORRADE_COMPARE(b, Vector4(7.0f, -1.7f, 8.0f, 0.0f)); CORRADE_COMPARE(c, 7.0f); CORRADE_COMPARE(d, 3.0f); diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index ad0f6d964..1bb9a2d5e 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -291,7 +291,10 @@ void VectorTest::data() { /* Pointer chasings, i.e. *(b.data()[3]), are not possible */ constexpr Vector4 a(1.0f, 2.0f, -3.0f, 4.5f); constexpr Float f = a[3]; - constexpr Float g = *a.data(); + #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Apparently dereferencing pointer is verboten */ + constexpr + #endif + Float g = *a.data(); CORRADE_COMPARE(f, 4.5f); CORRADE_COMPARE(g, 1.0f); }