From 683dbe24123d08519daf8ff492bbbed807ca6e17 Mon Sep 17 00:00:00 2001 From: Robert Leahy Date: Mon, 23 Dec 2019 11:22:25 -0500 Subject: [PATCH 1/3] .travis.yml: Specify Trusty for Trusty Addons Previously .travis.yml didn't specify dist: trusty when using addons which were specifically for Trusty. This led to the Clang 5 build failing when trying to install Clang 5. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2903ba1..b605585 100644 --- a/.travis.yml +++ b/.travis.yml @@ -151,6 +151,7 @@ matrix: - llvm-toolchain-precise-3.9 - os: linux + dist: trusty compiler: clang++-4.0 env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z addons: @@ -162,6 +163,7 @@ matrix: - llvm-toolchain-trusty-4.0 - os: linux + dist: trusty compiler: clang++-5.0 env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z addons: From d07ae789013e4fa38622efff65113b6bbfb31a85 Mon Sep 17 00:00:00 2001 From: Robert Leahy Date: Sun, 22 Dec 2019 16:12:28 -0500 Subject: [PATCH 2/3] Tests Pass in GCC 4.4.7 Several tests either did not compile or failed upon running when using GCC 4.4.7. --- test/optional_test_constructible_from_other.cpp | 10 ++++++---- test/optional_test_path_assignment.cpp | 4 ++++ test/optional_test_ref_converting_ctor.cpp | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/optional_test_constructible_from_other.cpp b/test/optional_test_constructible_from_other.cpp index e106b69..af85686 100644 --- a/test/optional_test_constructible_from_other.cpp +++ b/test/optional_test_constructible_from_other.cpp @@ -26,12 +26,14 @@ struct size_tag {}; template< typename T, typename U > struct is_constructible { - template< typename T1, typename U1 > - static yes_type check_helper(size_tag< sizeof(static_cast< T1 >(U1())) >*); - template< typename T1, typename U1 > + static U& get(); + + template< typename T1 > + static yes_type check_helper(size_tag< sizeof(static_cast< T1 >(get())) >*); + template< typename T1 > static no_type check_helper(...); - static const bool value = sizeof(check_helper< T, U >(0)) == sizeof(yes_type); + static const bool value = sizeof(check_helper< T >(0)) == sizeof(yes_type); }; template< typename T > diff --git a/test/optional_test_path_assignment.cpp b/test/optional_test_path_assignment.cpp index 6da6718..fa51fff 100644 --- a/test/optional_test_path_assignment.cpp +++ b/test/optional_test_path_assignment.cpp @@ -15,6 +15,8 @@ #pragma hdrstop #endif +#ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT +#ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS template struct void_t { @@ -42,6 +44,8 @@ struct Path template ::value_type> Path(T const&); }; +#endif +#endif int main() diff --git a/test/optional_test_ref_converting_ctor.cpp b/test/optional_test_ref_converting_ctor.cpp index 81f3c0f..e31904b 100644 --- a/test/optional_test_ref_converting_ctor.cpp +++ b/test/optional_test_ref_converting_ctor.cpp @@ -93,7 +93,9 @@ template void test_all_const_cases() { test_converting_ctor(); +#ifndef BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT test_converting_ctor(); +#endif test_converting_ctor_for_noconst_const(); } From 9581804efa0f658decab090a6914062ec826ec73 Mon Sep 17 00:00:00 2001 From: Robert Leahy Date: Sun, 22 Dec 2019 16:13:53 -0500 Subject: [PATCH 3/3] GCC 4.4.7: boost::in_place & Assignment Assigning a boost::in_place_factory to a boost::optional templated on a type which was trivially copyable failed to compile under GCC 4.4.7. --- .../optional/detail/optional_trivially_copyable_base.hpp | 2 +- test/optional_test_inplace_factory.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/optional/detail/optional_trivially_copyable_base.hpp b/include/boost/optional/detail/optional_trivially_copyable_base.hpp index 5a37eac..2cabf9a 100644 --- a/include/boost/optional/detail/optional_trivially_copyable_base.hpp +++ b/include/boost/optional/detail/optional_trivially_copyable_base.hpp @@ -359,7 +359,7 @@ class tc_optional_base : public optional_tag template void construct ( Expr const& factory, in_place_factory_base const* ) { - boost_optional_detail::construct(factory, m_storage.address()); + boost_optional_detail::construct(factory, boost::addressof(m_storage)); m_initialized = true ; } diff --git a/test/optional_test_inplace_factory.cpp b/test/optional_test_inplace_factory.cpp index 1e852f0..b8c3130 100644 --- a/test/optional_test_inplace_factory.cpp +++ b/test/optional_test_inplace_factory.cpp @@ -63,6 +63,9 @@ void test_ctor() BOOST_TEST(og1_ == og1); BOOST_TEST(og1_ != og2); BOOST_TEST(og1_ != og0); + + boost::optional o( boost::in_place(5) ); + BOOST_TEST(o && (*o == 5)); #endif } @@ -92,6 +95,10 @@ void test_assign() BOOST_TEST(og1_ == og1); BOOST_TEST(og1_ != og2); BOOST_TEST(og1_ != og0); + + boost::optional o; + o = boost::in_place(5); + BOOST_TEST(o && (*o == 5)); #endif #endif }