From c3abf834264d683a098bbc0638a34b35f359c929 Mon Sep 17 00:00:00 2001 From: Nikita Kniazev Date: Wed, 31 Aug 2016 17:37:50 +0300 Subject: [PATCH 1/5] Suppress weak vtables warning --- include/boost/optional/bad_optional_access.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/optional/bad_optional_access.hpp b/include/boost/optional/bad_optional_access.hpp index cabf43f..add7867 100644 --- a/include/boost/optional/bad_optional_access.hpp +++ b/include/boost/optional/bad_optional_access.hpp @@ -19,6 +19,11 @@ namespace boost { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wweak-vtables" +#endif + class bad_optional_access : public std::logic_error { public: @@ -27,6 +32,10 @@ public: {} }; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + } // namespace boost #endif From 683dbe24123d08519daf8ff492bbbed807ca6e17 Mon Sep 17 00:00:00 2001 From: Robert Leahy Date: Mon, 23 Dec 2019 11:22:25 -0500 Subject: [PATCH 2/5] .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 3/5] 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 4/5] 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 } From 19b94c01f39238dced0d8ed8f12a8179f3c2b0c6 Mon Sep 17 00:00:00 2001 From: Andrzej Krzemienski Date: Thu, 9 Apr 2020 01:12:22 +0200 Subject: [PATCH 5/5] added release notes --- doc/91_relnotes.qbk | 2 ++ doc/html/boost_optional/relnotes.html | 8 ++++++++ doc/html/index.html | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/91_relnotes.qbk b/doc/91_relnotes.qbk index b5be701..e4a5eaa 100644 --- a/doc/91_relnotes.qbk +++ b/doc/91_relnotes.qbk @@ -15,6 +15,8 @@ * Fixed [@https://github.com/boostorg/optional/issues/78 issue #78]. * `boost::none` is now declared as an inline variable (on compilers taht support it): there is only one instance of `boost::none` across all translation units. +* Fixed a number of compilation errors in GCC 4.4.7 in `optional` for trivial `T`s. Thanks to Robert Leahy for the fix. For details see [@https://github.com/boostorg/optional/pull/80 pr #78]. +* Now surpressing warning `-Wweak-vtables`. [heading Boost Release 1.69] diff --git a/doc/html/boost_optional/relnotes.html b/doc/html/boost_optional/relnotes.html index 333178d..6e93d04 100644 --- a/doc/html/boost_optional/relnotes.html +++ b/doc/html/boost_optional/relnotes.html @@ -40,6 +40,14 @@ boost::none is now declared as an inline variable (on compilers taht support it): there is only one instance of boost::none across all translation units. +
  • + Fixed a number of compilation errors in GCC 4.4.7 in optional<T> for trivial Ts. + Thanks to Robert Leahy for the fix. For details see pr + #78. +
  • +
  • + Now surpressing warning -Wweak-vtables. +
  • diff --git a/doc/html/index.html b/doc/html/index.html index 0a5611f..2862ec6 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -145,7 +145,7 @@ - +

    Last revised: December 19, 2019 at 23:27:43 GMT

    Last revised: April 08, 2020 at 23:09:18 GMT