From 0086a815a0119713b2d2af6d5f5467aafaba7fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 14 Dec 2013 16:10:00 +0100 Subject: [PATCH] GCC 4.4 compatibility: work around ambiguous constructor. That thing added its own variant of copy constructor and then complains that it is ambiguous with the other. --- src/Test/ColorTest.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index dfb5897e3..3f99723df 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -93,15 +93,30 @@ ColorTest::ColorTest() { } void ColorTest::construct() { + /* GCC 4.4 added its own variant of copy constructor and then thinks this + is ambiguous */ + #ifndef CORRADE_GCC44_COMPATIBILITY constexpr Color3 a = {1.0f, 0.5f, 0.75f}; + #else + constexpr Color3 a{1.0f, 0.5f, 0.75f}; + #endif CORRADE_COMPARE(a, Vector3(1.0f, 0.5f, 0.75f)); + #ifndef CORRADE_GCC44_COMPATIBILITY constexpr Color4 b = {1.0f, 0.5f, 0.75f, 0.5f}; + #else + constexpr Color4 b{1.0f, 0.5f, 0.75f, 0.5f}; + #endif CORRADE_COMPARE(b, Vector4(1.0f, 0.5f, 0.75f, 0.5f)); /* Default alpha */ + #ifndef CORRADE_GCC44_COMPATIBILITY constexpr Color4 c = {1.0f, 0.5f, 0.75f}; constexpr Color4ub d = {10, 25, 176}; + #else + constexpr Color4 c{1.0f, 0.5f, 0.75f}; + constexpr Color4ub d{10, 25, 176}; + #endif CORRADE_COMPARE(c, Vector4(1.0f, 0.5f, 0.75f, 1.0f)); CORRADE_COMPARE(d, Math::Vector4(10, 25, 176, 255)); }