Browse Source

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.
Vladimír Vondruš 13 years ago
parent
commit
0086a815a0
  1. 15
      src/Test/ColorTest.cpp

15
src/Test/ColorTest.cpp

@ -93,15 +93,30 @@ ColorTest::ColorTest() {
} }
void ColorTest::construct() { 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}; 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)); 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}; 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)); CORRADE_COMPARE(b, Vector4(1.0f, 0.5f, 0.75f, 0.5f));
/* Default alpha */ /* Default alpha */
#ifndef CORRADE_GCC44_COMPATIBILITY
constexpr Color4 c = {1.0f, 0.5f, 0.75f}; constexpr Color4 c = {1.0f, 0.5f, 0.75f};
constexpr Color4ub d = {10, 25, 176}; 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(c, Vector4(1.0f, 0.5f, 0.75f, 1.0f));
CORRADE_COMPARE(d, Math::Vector4<UnsignedByte>(10, 25, 176, 255)); CORRADE_COMPARE(d, Math::Vector4<UnsignedByte>(10, 25, 176, 255));
} }

Loading…
Cancel
Save