From 1102232a2477ac34ca946cf986192b7c50e3909e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 3 Aug 2013 14:57:09 +0200 Subject: [PATCH] GCC 4.6 compatibility: no delegating constructors. --- src/SceneGraph/AbstractFeature.h | 9 ++++++++- src/SceneGraph/Camera2D.h | 7 ++++++- src/SceneGraph/Camera3D.h | 7 ++++++- src/Test/ArrayTest.cpp | 4 ++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/SceneGraph/AbstractFeature.h b/src/SceneGraph/AbstractFeature.h index decaf76b7..27aed780a 100644 --- a/src/SceneGraph/AbstractFeature.h +++ b/src/SceneGraph/AbstractFeature.h @@ -180,7 +180,14 @@ template class MAGNUM_SCENEGRAPH_EXPORT Abstrac /* This is here to avoid ambiguity with deleted copy constructor when passing `*this` from class subclassing both AbstractFeature and AbstractObject */ - template, U>::value>::type> AbstractFeature(U& object): AbstractFeature(static_cast&>(object)) {} + template, U>::value>::type> AbstractFeature(U& object) + #ifndef CORRADE_GCC46_COMPATIBILITY + : AbstractFeature(static_cast&>(object)) {} + #else + { + object.Containers::template LinkedList>::insert(this); + } + #endif #endif virtual ~AbstractFeature() = 0; diff --git a/src/SceneGraph/Camera2D.h b/src/SceneGraph/Camera2D.h index d1be4b0db..b11be1474 100644 --- a/src/SceneGraph/Camera2D.h +++ b/src/SceneGraph/Camera2D.h @@ -71,7 +71,12 @@ template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D: public AbstractC /* This is here to avoid ambiguity with deleted copy constructor when passing `*this` from class subclassing both BasicCamera2D and AbstractObject */ - template, U>::value>::type> BasicCamera2D(U& object): BasicCamera2D(static_cast&>(object)) {} + template, U>::value>::type> BasicCamera2D(U& object): + #ifndef CORRADE_GCC46_COMPATIBILITY + BasicCamera2D(static_cast&>(object)) {} + #else + AbstractCamera<2, T>(static_cast&>(object)) {} + #endif #endif /** diff --git a/src/SceneGraph/Camera3D.h b/src/SceneGraph/Camera3D.h index 6d6c665f4..2b1c430e1 100644 --- a/src/SceneGraph/Camera3D.h +++ b/src/SceneGraph/Camera3D.h @@ -73,7 +73,12 @@ template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D: public AbstractC /* This is here to avoid ambiguity with deleted copy constructor when passing `*this` from class subclassing both BasicCamera3D and AbstractObject */ - template, U>::value>::type> BasicCamera3D(U& object): BasicCamera3D(static_cast&>(object)) {} + template, U>::value>::type> BasicCamera3D(U& object): + #ifndef CORRADE_GCC46_COMPATIBILITY + BasicCamera3D(static_cast&>(object)) {} + #else + AbstractCamera<3, T>(static_cast&>(object)) {} + #endif #endif /** diff --git a/src/Test/ArrayTest.cpp b/src/Test/ArrayTest.cpp index 69ade4dfe..1a677aa33 100644 --- a/src/Test/ArrayTest.cpp +++ b/src/Test/ArrayTest.cpp @@ -51,7 +51,11 @@ void ArrayTest::construct() { constexpr Array<3, Int> a = {5, 6, 7}; CORRADE_COMPARE(a, (Array<3, Int>(5, 6, 7))); + #ifndef CORRADE_GCC46_COMPATIBILITY constexpr Array<3, Int> a2 = 5; + #else + Array<3, Int> a2 = 5; /* Not constexpr under GCC < 4.7 */ + #endif CORRADE_COMPARE(a2, (Array<3, Int>(5, 5, 5))); constexpr Array1D b = 5;