From 99062ed248327808239910e160ee6c3070c0331a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 28 Feb 2013 17:43:44 +0100 Subject: [PATCH] GCC 4.6 compatibility: no delegating ctr in Math::RectangularMatrix. --- src/Math/RectangularMatrix.h | 6 ++++++ src/Math/Test/RectangularMatrixTest.cpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Math/RectangularMatrix.h b/src/Math/RectangularMatrix.h index 982a1fa5d..af38a25d2 100644 --- a/src/Math/RectangularMatrix.h +++ b/src/Math/RectangularMatrix.h @@ -112,7 +112,13 @@ template class RectangularMatrix { * // integral == {1, 2, -15, 7} * @endcode */ + #ifndef CORRADE_GCC46_COMPATIBILITY template inline constexpr explicit RectangularMatrix(const RectangularMatrix& other): RectangularMatrix(typename Implementation::GenerateSequence::Type(), other) {} + #else + template inline explicit RectangularMatrix(const RectangularMatrix& other) { + *this = RectangularMatrix(typename Implementation::GenerateSequence::Type(), other); + } + #endif /** @brief Copy constructor */ inline constexpr RectangularMatrix(const RectangularMatrix&) = default; diff --git a/src/Math/Test/RectangularMatrixTest.cpp b/src/Math/Test/RectangularMatrixTest.cpp index 2e1cf095d..00d8de449 100644 --- a/src/Math/Test/RectangularMatrixTest.cpp +++ b/src/Math/Test/RectangularMatrixTest.cpp @@ -193,13 +193,15 @@ void RectangularMatrixTest::constExpressions() { Vector4(4.5f, 4.0f, 7.0f, 3.0f), Vector4(7.0f, -1.7f, 8.0f, 0.0f))); - /* Conversion constructor */ + /* Conversion constructor, not constexpr under GCC < 4.7 */ + #ifndef CORRADE_GCC46_COMPATIBILITY typedef RectangularMatrix<3, 4, Int> Matrix3x4i; typedef Vector<4, Int> Vector4i; constexpr Matrix3x4i c(b); CORRADE_COMPARE(c, Matrix3x4i(Vector4i(3, 5, 8, 4), Vector4i(4, 4, 7, 3), Vector4i(7, -1, 8, 0))); + #endif /* Copy constructor */ constexpr Matrix3x4 d(b);