From fe34412116de5eca9e27ce7d4dbc2a2fecce854d Mon Sep 17 00:00:00 2001 From: CromwellEnage <32967088+CromwellEnage@users.noreply.github.com> Date: Fri, 4 Jan 2019 03:57:15 -0500 Subject: [PATCH] Add workarounds for GCC 3.x or earlier * Fix compiler error: base `boost::reference_wrapper' with only non-default constructor in class without a constructor. * Ignore normalized_argument_types test failures. --- .../parameter/aux_/unwrap_cv_reference.hpp | 10 ++++++---- test/normalized_argument_types.cpp | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/include/boost/parameter/aux_/unwrap_cv_reference.hpp b/include/boost/parameter/aux_/unwrap_cv_reference.hpp index b2ffe2a..43c4c37 100644 --- a/include/boost/parameter/aux_/unwrap_cv_reference.hpp +++ b/include/boost/parameter/aux_/unwrap_cv_reference.hpp @@ -51,7 +51,8 @@ namespace boost { namespace parameter { namespace aux { #include #include -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \ + !BOOST_WORKAROUND(BOOST_GCC, < 40000) #include #endif @@ -83,7 +84,8 @@ namespace boost { namespace parameter { namespace aux { value> type; }; -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) || \ + BOOST_WORKAROUND(BOOST_GCC, < 40000) template < typename T , typename = typename ::boost::parameter::aux @@ -103,7 +105,7 @@ namespace boost { namespace parameter { namespace aux { struct unwrap_cv_reference : T { }; -#else // !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#else // no Borland or GCC 3- workarounds needed // Needed for unwrap_cv_reference below. T might be const, so // eval_if<> might fail because of deriving from T const on EDG. template @@ -123,7 +125,7 @@ namespace boost { namespace parameter { namespace aux { > { }; -#endif // Borland workarounds needed. +#endif // Borland or GCC 3- workarounds needed }}} // namespace boost::parameter::aux #endif // include guard diff --git a/test/normalized_argument_types.cpp b/test/normalized_argument_types.cpp index 36aaf9d..1017473 100644 --- a/test/normalized_argument_types.cpp +++ b/test/normalized_argument_types.cpp @@ -5,17 +5,14 @@ #include -#if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) #if (BOOST_PARAMETER_MAX_ARITY < 2) #error Define BOOST_PARAMETER_MAX_ARITY as 2 or greater. #endif -#if (BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY < 3) +#if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) && \ + (BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY < 3) #error Define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY \ as 3 or greater. #endif -#endif - -#include namespace test { @@ -50,11 +47,17 @@ namespace test { }; std::size_t count_instances::count = 0; +} // namespace test + +#include + +namespace test { BOOST_PARAMETER_NAME(x) BOOST_PARAMETER_NAME(y) } // namespace test +#include #include #include #include @@ -107,7 +110,9 @@ namespace test { >::type )); x.noop(); +#if !BOOST_WORKAROUND(BOOST_GCC, < 40000) BOOST_TEST_LT(0, test::count_instances::count); +#endif return 0; } @@ -125,7 +130,9 @@ namespace test { >::type )); x.noop(); +#if !BOOST_WORKAROUND(BOOST_GCC, < 40000) BOOST_TEST_EQ(1, test::count_instances::count); +#endif return 0; } } // namespace test