Skip to content

Commit

Permalink
boost: Fix compilation errors with newer Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Artalus committed Aug 16, 2024
1 parent ab3333f commit c5176d8
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 0 deletions.
60 changes: 60 additions & 0 deletions recipes/boost/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ patches:
patch_description: "Fix aliasing violation in boost::container"
patch_type: "official"
patch_source: "https://github.com/boostorg/container/commit/20ad12f20e661978e90dc7f36d8ab8ac05e5a5a9"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.84.0":
- patch_file: "patches/1.82.0-locale-iconv-library-option.patch"
patch_description: "Optional flag to specify iconv from either libc of libiconv"
Expand All @@ -89,6 +93,10 @@ patches:
patch_description: "Fix compilation with cppstd=20 on libcxx platforms (e.g. MacOS)"
patch_type: "official"
patch_source: "https://github.com/boostorg/locale/commit/c5e8f02c903696a213fc4b710f6740ccd1f07f4e"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.83.0":
- patch_file: "patches/1.82.0-locale-iconv-library-option.patch"
patch_description: "Optional flag to specify iconv from either libc of libiconv"
Expand All @@ -97,17 +105,29 @@ patches:
patch_description: "Fix compilation on windows when NOMINMAX is not defined"
patch_type: "official"
patch_source: "https://github.com/boostorg/locale/pull/189"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.82.0":
- patch_file: "patches/1.82.0-locale-iconv-library-option.patch"
patch_description: "Optional flag to specify iconv from either libc of libiconv"
patch_type: "conan"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.81.0":
- patch_file: "patches/boost_1_77_mpi_check.patch"
patch_description: "Fails the build when mpi is not configured"
patch_type: "conan"
- patch_file: "patches/1.81.0-locale-fail-on-missing-backend.patch"
patch_description: "Fails the build when there is no iconv backend"
patch_type: "conan"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.80.0":
- patch_file: "patches/1.80.0-locale-fail-on-missing-backend.patch"
patch_description: "Fails the build when there is no iconv backend"
Expand Down Expand Up @@ -139,6 +159,10 @@ patches:
patch_description: "Fix MSVC /RTCc build runtime failures."
patch_type: "official"
patch_source: "https://www.boost.org/patches/1_80_0/0006-unordered-msvc-rtcc.patch"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.79.0":
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
patch_description: "Fails the build when there is no iconv backend"
Expand All @@ -163,6 +187,10 @@ patches:
patch_description: "Fix access specifier preventing use of experimental iterators. Allow more granular control over enabled experimental features."
patch_type: "portability"
patch_source: "https://github.com/boostorg/geometry/discussions/1041"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.78.0":
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
patch_description: "Fails the build when there is no iconv backend"
Expand All @@ -183,6 +211,10 @@ patches:
patch_description: "Don't skip install targets if there's <build>no in ureqs"
patch_type: "official"
patch_source: "https://github.com/boostorg/build/pull/113"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.77.0":
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
patch_description: "Fails the build when there is no iconv backend"
Expand All @@ -202,6 +234,10 @@ patches:
- patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch"
patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')"
patch_type: "conan"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.76.0":
- patch_file: "patches/boost_locale_fail_on_missing_backend.patch"
patch_description: "Fails the build when there is no iconv backend"
Expand All @@ -222,6 +258,10 @@ patches:
- patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch"
patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')"
patch_type: "conan"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.75.0":
- patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch"
patch_description: ""
Expand All @@ -244,6 +284,10 @@ patches:
- patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch"
patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')"
patch_type: "conan"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.74.0":
- patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch"
patch_description: ""
Expand All @@ -269,6 +313,10 @@ patches:
- patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch"
patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')"
patch_type: "conan"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.73.0":
- patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch"
patch_description: ""
Expand All @@ -294,6 +342,10 @@ patches:
- patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch"
patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')"
patch_type: "conan"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.72.0":
- patch_file: "patches/bcp_namespace_issues_1_72.patch"
patch_description: ""
Expand Down Expand Up @@ -334,6 +386,10 @@ patches:
- patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch"
patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')"
patch_type: "conan"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
"1.71.0":
- patch_file: "patches/bcp_namespace_issues_1_71.patch"
patch_description: ""
Expand Down Expand Up @@ -371,3 +427,7 @@ patches:
- patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch"
patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')"
patch_type: "conan"
- patch_file: patches/boost_build-with-newer-clang.patch
patch_description: Fix MPL/Numeric compilation errors with newer Clang
patch_type: portability
patch_source: https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a , https://github.com/boostorg/mpl/pull/77
89 changes: 89 additions & 0 deletions recipes/boost/all/patches/boost_build-with-newer-clang.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
diff --git a/boost/numeric/conversion/detail/int_float_mixture.hpp b/boost/numeric/conversion/detail/int_float_mixture.hpp
index 464e527..7690d07 100644
--- a/boost/numeric/conversion/detail/int_float_mixture.hpp
+++ b/boost/numeric/conversion/detail/int_float_mixture.hpp
@@ -16,15 +16,15 @@
#include "boost/numeric/conversion/int_float_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"

-#include "boost/mpl/integral_c.hpp"
+#include "boost/type_traits/integral_constant.hpp"

namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'IntFloatMixture'
- typedef mpl::integral_c<int_float_mixture_enum, integral_to_integral> int2int_c ;
- typedef mpl::integral_c<int_float_mixture_enum, integral_to_float> int2float_c ;
- typedef mpl::integral_c<int_float_mixture_enum, float_to_integral> float2int_c ;
- typedef mpl::integral_c<int_float_mixture_enum, float_to_float> float2float_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, integral_to_integral> int2int_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, integral_to_float> int2float_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, float_to_integral> float2int_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, float_to_float> float2float_c ;

// Metafunction:
//
diff --git a/boost/numeric/conversion/detail/sign_mixture.hpp b/boost/numeric/conversion/detail/sign_mixture.hpp
index c7f9e42..fde1584 100644
--- a/boost/numeric/conversion/detail/sign_mixture.hpp
+++ b/boost/numeric/conversion/detail/sign_mixture.hpp
@@ -16,15 +16,15 @@
#include "boost/numeric/conversion/sign_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"

-#include "boost/mpl/integral_c.hpp"
+#include "boost/type_traits/integral_constant.hpp"

namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'SignMixture'
- typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
- typedef mpl::integral_c<sign_mixture_enum, signed_to_signed> sig2sig_c ;
- typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
- typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, signed_to_signed> sig2sig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;

// Metafunction:
//
diff --git a/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
index 36dbc49..a39d29f 100644
--- a/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
+++ b/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
@@ -15,15 +15,15 @@
#include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"

-#include "boost/mpl/integral_c.hpp"
+#include "boost/type_traits/integral_constant.hpp"

namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'UdtMixture'
- typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
- typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
- typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
- typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;

// Metafunction:
//
diff --git a/boost/mpl/aux_/integral_wrapper.hpp b/boost/mpl/aux_/integral_wrapper.hpp
index 8748fbb93..5f24b7949 100644
--- a/boost/mpl/aux_/integral_wrapper.hpp
+++ b/boost/mpl/aux_/integral_wrapper.hpp
@@ -56,7 +56,8 @@ struct AUX_WRAPPER_NAME
// have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC),
// while some other don't like 'value + 1' (Borland), and some don't like
// either
-#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
+#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \
+ || __cplusplus >= 201103L
private:
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));

0 comments on commit c5176d8

Please sign in to comment.