From f077c14d470665b8d88b339c689ab26ac0697a5f Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 5 Jan 2016 21:59:42 +0100 Subject: [PATCH] compiler evolution: get rid of a gcc-4.7 workaround our minimal compiler requirement is gcc-4.9 since the transition to Debian/Jessie as reference system. gcc-4.9 is known to treat SFINAE on private fields properly --- src/lib/meta/virtual-copy-support.hpp | 25 +++---------------- src/lib/variant.hpp | 2 +- .../meta/virtual-copy-support-test.cpp | 11 -------- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/src/lib/meta/virtual-copy-support.hpp b/src/lib/meta/virtual-copy-support.hpp index dc9be739b..47720630f 100644 --- a/src/lib/meta/virtual-copy-support.hpp +++ b/src/lib/meta/virtual-copy-support.hpp @@ -117,10 +117,6 @@ #include #include -namespace lib { -namespace time{ - class Time; // forward declaration for GCC 4.7 workaround -}} namespace lib { namespace meta{ @@ -242,26 +238,11 @@ namespace meta{ namespace { // helpers to select suitable variant of copy support... - /** workaround for GCC 4.7: need to exclude some types, - * since they raise private access violation during probing. - * Actually, in C++11 such a case should trigger substitution - * failure, not an compilation error */ - template - struct can_use_assignment - : is_copy_assignable - { }; - - template<> - struct can_use_assignment - { static constexpr bool value = false; }; - - - template struct supports_only_move : __and_ ,__not_> - ,__not_> + ,__not_> > { }; @@ -269,7 +250,7 @@ namespace meta{ struct supports_cloning : __and_ ,is_copy_constructible - ,__not_> + ,__not_> > { }; @@ -277,7 +258,7 @@ namespace meta{ struct supports_copy_and_assignment : __and_ ,is_copy_constructible - ,can_use_assignment + ,is_copy_assignable > { }; } diff --git a/src/lib/variant.hpp b/src/lib/variant.hpp index b7d056b96..6c7db32ae 100644 --- a/src/lib/variant.hpp +++ b/src/lib/variant.hpp @@ -418,7 +418,7 @@ namespace lib { using RawType = typename remove_reference::type; static_assert (meta::isInList(), "Type error: the given variant could never hold the required type"); - static_assert (meta::can_use_assignment::value, "target type does not support assignment"); + static_assert (std::is_copy_assignable::value, "target type does not support assignment"); buff() = forward(x); return *this; diff --git a/tests/library/meta/virtual-copy-support-test.cpp b/tests/library/meta/virtual-copy-support-test.cpp index fce2e9180..64214da35 100644 --- a/tests/library/meta/virtual-copy-support-test.cpp +++ b/tests/library/meta/virtual-copy-support-test.cpp @@ -241,17 +241,6 @@ namespace test { }//(End)Test fixture -// GCC 4.7 workaround -// SFINAE does not work properly on private functions -// instead of dropping the template instance, it causes compilation failure - -}//now in namespace meta - - template - struct can_use_assignment> - { static constexpr bool value = false; }; - -namespace test {