From e3a540b33d5a00ec9c2f25bf3cfcdb7745c017a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 30 Oct 2013 13:51:28 +0100 Subject: [PATCH] GCC 4.5 compatibility: constexpr-related issues. --- src/Math/Test/Vector2Test.cpp | 8 +++++++- src/Math/Test/Vector3Test.cpp | 8 +++++++- src/Math/Test/Vector4Test.cpp | 8 +++++++- src/Test/ColorTest.cpp | 28 ++++++++++++++++++++++++---- 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/src/Math/Test/Vector2Test.cpp b/src/Math/Test/Vector2Test.cpp index 52a9b97e8..391f6677b 100644 --- a/src/Math/Test/Vector2Test.cpp +++ b/src/Math/Test/Vector2Test.cpp @@ -216,7 +216,13 @@ void Vector2Test::aspectRatio() { void Vector2Test::swizzleType() { constexpr Vector<4, Int> orig; - constexpr auto a = swizzle<'y', 'a'>(orig); + + #ifndef CORRADE_GCC45_COMPATIBILITY + constexpr + #else + const + #endif + auto a = swizzle<'y', 'a'>(orig); CORRADE_VERIFY((std::is_same::value)); } diff --git a/src/Math/Test/Vector3Test.cpp b/src/Math/Test/Vector3Test.cpp index e30f60a57..d34b50960 100644 --- a/src/Math/Test/Vector3Test.cpp +++ b/src/Math/Test/Vector3Test.cpp @@ -236,7 +236,13 @@ void Vector3Test::twoComponent() { void Vector3Test::swizzleType() { constexpr Vector<4, Int> orig; - constexpr auto b = swizzle<'y', 'z', 'a'>(orig); + + #ifndef CORRADE_GCC45_COMPATIBILITY + constexpr + #else + const + #endif + auto b = swizzle<'y', 'z', 'a'>(orig); CORRADE_VERIFY((std::is_same::value)); } diff --git a/src/Math/Test/Vector4Test.cpp b/src/Math/Test/Vector4Test.cpp index c055870a5..4502e31a7 100644 --- a/src/Math/Test/Vector4Test.cpp +++ b/src/Math/Test/Vector4Test.cpp @@ -228,7 +228,13 @@ void Vector4Test::twoComponent() { void Vector4Test::swizzleType() { constexpr Vector4i orig; - constexpr auto c = swizzle<'y', 'a', 'y', 'x'>(orig); + + #ifndef CORRADE_GCC45_COMPATIBILITY + constexpr + #else + const + #endif + auto c = swizzle<'y', 'a', 'y', 'x'>(orig); CORRADE_VERIFY((std::is_same::value)); } diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index 657802f65..d1332871a 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -143,16 +143,36 @@ void ColorTest::swizzleType() { constexpr Color3 origColor3; constexpr BasicColor4 origColor4; - constexpr auto a = Math::swizzle<'y', 'z', 'r'>(origColor3); + #ifndef CORRADE_GCC45_COMPATIBILITY + constexpr + #else + const + #endif + auto a = Math::swizzle<'y', 'z', 'r'>(origColor3); CORRADE_VERIFY((std::is_same::value)); - constexpr auto b = Math::swizzle<'y', 'z', 'a'>(origColor4); + #ifndef CORRADE_GCC45_COMPATIBILITY + constexpr + #else + const + #endif + auto b = Math::swizzle<'y', 'z', 'a'>(origColor4); CORRADE_VERIFY((std::is_same>::value)); - constexpr auto c = Math::swizzle<'y', 'z', 'y', 'x'>(origColor3); + #ifndef CORRADE_GCC45_COMPATIBILITY + constexpr + #else + const + #endif + auto c = Math::swizzle<'y', 'z', 'y', 'x'>(origColor3); CORRADE_VERIFY((std::is_same::value)); - constexpr auto d = Math::swizzle<'y', 'a', 'y', 'x'>(origColor4); + #ifndef CORRADE_GCC45_COMPATIBILITY + constexpr + #else + const + #endif + auto d = Math::swizzle<'y', 'a', 'y', 'x'>(origColor4); CORRADE_VERIFY((std::is_same>::value)); }