From d1138fc9eb1ad1d5827314aa8f7e8adb6e5e52b8 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Fri, 4 Dec 2026 02:59:58 +0000 Subject: [PATCH 01/21] ci(tests): add msvc@system leg on Windows and pin MSVC via setup-msvc-dev --- .github/workflows/tests.yml | 52 +++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4cbd5a84..bd1f1944 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,9 +1,10 @@ # Boost 1.92.0 as C++23 named modules (mcpplibs.mwrap.boost) — build/test matrix. # # Ported from the pre-mwrap wrapper's CI (boost-module b1.92.0wdev tests.yml). -# The five host configurations and their pinned toolchains are the ones that -# wrapper validated; keep the set if a leg is added or dropped: +# The six host configurations and their pinned toolchains are the ones that +# CI validates; keep the set if a leg is added or dropped: # +# windows-latest x86_64 msvc@system (cl.exe, MSVC 14.52 + SDK 10.0.26100.0) # windows-latest x86_64 llvm@23.1.3 (clang-cl / clang-msvc) # ubuntu-24.04 x86_64 gcc@16.1.0 # ubuntu-24.04-arm arm64 gcc@16.1.0 @@ -31,7 +32,7 @@ # # The examples, the template smoke test and the release-page check run in the # `examples` job, which `needs: [test]`: they start only after both groups have -# passed on all five hosts. +# passed on all six hosts. # # mcpp comes from the repository's own pin: xlings installs `mcpp 2026.11.27.1` # (only that entry of `.xlings.json`; its `llvm` pin is the generator's), and @@ -61,6 +62,9 @@ env: XLINGS_NON_INTERACTIVE: '1' # Must match [workspace].mcpp in .xlings.json — checked on every leg. MCPP_VERSION: "2026.11.27.1" + # Pinned MSVC toolset and Windows SDK on windows-latest (setup-msvc-dev). + MSVC_TOOLSET: "14.52" + WINDOWS_SDK: "10.0.26100.0" # Leave the runners room: the vendored tree is large and every leg compiles # Boost from the same checkout. MCPP_JOBS: '4' @@ -97,6 +101,7 @@ jobs: fail-fast: false matrix: target: + - { name: windows-msvc, os: windows-latest, arch: x86_64, toolchain: "msvc@system", install: "" } - { name: windows-llvm-msvc, os: windows-latest, arch: x86_64, toolchain: "llvm@23.1.3", install: "llvm 23.1.3" } - { name: linux-gcc, os: ubuntu-24.04, arch: x86_64, toolchain: "gcc@16.1.0", install: "gcc 16.1.0" } - { name: linux-gcc, os: ubuntu-24.04-arm, arch: arm64, toolchain: "gcc@16.1.0", install: "gcc 16.1.0" } @@ -106,6 +111,14 @@ jobs: steps: - uses: actions/checkout@v7 + - name: Set up MSVC (${{ env.MSVC_TOOLSET }}, SDK ${{ env.WINDOWS_SDK }}) + if: runner.os == 'Windows' + uses: TheMrMilchmann/setup-msvc-dev@v4 + with: + arch: x64 + toolset: ${{ env.MSVC_TOOLSET }} + sdk: ${{ env.WINDOWS_SDK }} + # Warm the mcpp sandbox (engine, registry, toolchain payloads and the # global BMI cache). Keyed per toolchain so the gcc and llvm legs on one # OS cannot restore each other's default (config.toml); A and B share the @@ -114,9 +127,9 @@ jobs: uses: actions/cache@v6 with: path: ~/.mcpp - key: mcpp-${{ matrix.target.os }}-${{ matrix.target.name }}-${{ matrix.target.arch }}-${{ matrix.target.toolchain }}-v${{ env.MCPP_VERSION }} + key: mcpp-${{ matrix.target.os }}-${{ matrix.target.name }}-${{ matrix.target.arch }}-${{ matrix.target.toolchain }}${{ matrix.target.toolchain == 'msvc@system' && format('-{0}-{1}', env.MSVC_TOOLSET, env.WINDOWS_SDK) || '' }}-v${{ env.MCPP_VERSION }} restore-keys: | - mcpp-${{ matrix.target.os }}-${{ matrix.target.name }}-${{ matrix.target.arch }}-${{ matrix.target.toolchain }}- + mcpp-${{ matrix.target.os }}-${{ matrix.target.name }}-${{ matrix.target.arch }}-${{ matrix.target.toolchain }}${{ matrix.target.toolchain == 'msvc@system' && format('-{0}-{1}', env.MSVC_TOOLSET, env.WINDOWS_SDK) || '' }}- - name: Install xlings if: runner.os != 'Windows' @@ -154,8 +167,10 @@ jobs: shell: bash run: | set -euo pipefail - mcpp toolchain install ${{ matrix.target.install }} - mcpp toolchain default ${{ matrix.target.toolchain }} + if [ -n "${{ matrix.target.install }}" ]; then + mcpp toolchain install ${{ matrix.target.install }} + fi + mcpp toolchain default "${{ matrix.target.toolchain }}" mcpp toolchain list # Guard the grouping invariant: every library feature in mcpp.toml is in @@ -278,6 +293,11 @@ jobs: fail-fast: false matrix: include: + - name: windows-msvc + os: windows-latest + arch: x86_64 + toolchain: msvc@system + install: "" - name: windows-llvm-msvc os: windows-latest arch: x86_64 @@ -306,13 +326,21 @@ jobs: steps: - uses: actions/checkout@v7 + - name: Set up MSVC (${{ env.MSVC_TOOLSET }}, SDK ${{ env.WINDOWS_SDK }}) + if: runner.os == 'Windows' + uses: TheMrMilchmann/setup-msvc-dev@v4 + with: + arch: x64 + toolset: ${{ env.MSVC_TOOLSET }} + sdk: ${{ env.WINDOWS_SDK }} + - name: Cache mcpp sandbox uses: actions/cache@v6 with: path: ~/.mcpp - key: mcpp-${{ matrix.os }}-${{ matrix.name }}-${{ matrix.arch }}-${{ matrix.toolchain }}-v${{ env.MCPP_VERSION }} + key: mcpp-${{ matrix.os }}-${{ matrix.name }}-${{ matrix.arch }}-${{ matrix.toolchain }}${{ matrix.toolchain == 'msvc@system' && format('-{0}-{1}', env.MSVC_TOOLSET, env.WINDOWS_SDK) || '' }}-v${{ env.MCPP_VERSION }} restore-keys: | - mcpp-${{ matrix.os }}-${{ matrix.name }}-${{ matrix.arch }}-${{ matrix.toolchain }}- + mcpp-${{ matrix.os }}-${{ matrix.name }}-${{ matrix.arch }}-${{ matrix.toolchain }}${{ matrix.toolchain == 'msvc@system' && format('-{0}-{1}', env.MSVC_TOOLSET, env.WINDOWS_SDK) || '' }}- - name: Install xlings if: runner.os != 'Windows' @@ -348,8 +376,10 @@ jobs: shell: bash run: | set -euo pipefail - mcpp toolchain install ${{ matrix.install }} - mcpp toolchain default ${{ matrix.toolchain }} + if [ -n "${{ matrix.install }}" ]; then + mcpp toolchain install ${{ matrix.install }} + fi + mcpp toolchain default "${{ matrix.toolchain }}" mcpp toolchain list # examples/basic consumes the root package as a path dependency with an From 25ec4c4dc0c963ea7171b3c523df013be5f68bfe Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Fri, 4 Dec 2026 08:10:34 +0000 Subject: [PATCH 02/21] fix(hana): guard experimental/type_name.hpp for MSVC --- generated/exports/hana.inc | 15 +++++++++++++++ generated/meta/skipped.txt | 4 ++++ src/hana.cppm | 3 +++ tools/export_policy.toml | 17 +++++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/generated/exports/hana.inc b/generated/exports/hana.inc index 3e0afe02..ddd6846d 100644 --- a/generated/exports/hana.inc +++ b/generated/exports/hana.inc @@ -861,17 +861,32 @@ export namespace boost { namespace hana { namespace experimental { using boost::hana::experimental::sliced_view_t; using boost::hana::experimental::transformed; using boost::hana::experimental::transformed_view_t; +#if defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC) + // boost/hana/experimental/type_name.hpp #errors outside BOOST_HANA_CONFIG_CLANG + // and BOOST_HANA_CONFIG_GCC (no MSVC support); src/hana.cppm guards its include + // under the same condition. using boost::hana::experimental::type_name; +#endif using boost::hana::experimental::types; using boost::hana::experimental::types_tag; using boost::hana::experimental::view_tag; }}} export namespace boost { namespace hana { namespace experimental { namespace detail { +#if defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC) + // boost/hana/experimental/type_name.hpp #errors outside BOOST_HANA_CONFIG_CLANG + // and BOOST_HANA_CONFIG_GCC (no MSVC support); src/hana.cppm guards its include + // under the same condition. using boost::hana::experimental::detail::cstring; +#endif using boost::hana::experimental::detail::is_view; +#if defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC) + // boost/hana/experimental/type_name.hpp #errors outside BOOST_HANA_CONFIG_CLANG + // and BOOST_HANA_CONFIG_GCC (no MSVC support); src/hana.cppm guards its include + // under the same condition. using boost::hana::experimental::detail::type_name_impl1; using boost::hana::experimental::detail::type_name_impl2; +#endif using boost::hana::experimental::detail::view_storage; }}}} diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index 11395376..22fa3f4f 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -240,6 +240,10 @@ graph unreachable boost::mpl::identity -- Boost.MPL is include-only (docs/usage. graph unreachable boost::parameter::keyword -- Boost.Parameter is include-only (docs/usage.md §2.3): no module owns its names. This library's headers use it to build their own named parameters, which are exported; its documentation, examples and tests in the 1.92.0 release never make a user spell this one (accumulators' reference shows keyword only as the type of static members). The generator before #1 listed it here through a specialization; now the first module whose signatures mention keyword (convert) has it, and flyweight, the first for the others, drops it. A program that spells it includes the header. graph unreachable boost::parameter::parameters -- Boost.Parameter is include-only (docs/usage.md §2.3): no module owns its names. This library's headers use it to build their own named parameters, which are exported; its documentation, examples and tests in the 1.92.0 release never make a user spell this one (accumulators' reference shows keyword only as the type of static members). The generator before #1 listed it here through a specialization; now the first module whose signatures mention keyword (convert) has it, and flyweight, the first for the others, drops it. A program that spells it includes the header. graph unreachable boost::parameter::required -- Boost.Parameter is include-only (docs/usage.md §2.3): no module owns its names. This library's headers use it to build their own named parameters, which are exported; its documentation, examples and tests in the 1.92.0 release never make a user spell this one (accumulators' reference shows keyword only as the type of static members). The generator before #1 listed it here through a specialization; now the first module whose signatures mention keyword (convert) has it, and flyweight, the first for the others, drops it. A program that spells it includes the header. +hana guard boost::hana::experimental::detail::cstring if defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC) -- boost/hana/experimental/type_name.hpp #errors outside BOOST_HANA_CONFIG_CLANG and BOOST_HANA_CONFIG_GCC (no MSVC support); src/hana.cppm guards its include under the same condition. +hana guard boost::hana::experimental::detail::type_name_impl1 if defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC) -- boost/hana/experimental/type_name.hpp #errors outside BOOST_HANA_CONFIG_CLANG and BOOST_HANA_CONFIG_GCC (no MSVC support); src/hana.cppm guards its include under the same condition. +hana guard boost::hana::experimental::detail::type_name_impl2 if defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC) -- boost/hana/experimental/type_name.hpp #errors outside BOOST_HANA_CONFIG_CLANG and BOOST_HANA_CONFIG_GCC (no MSVC support); src/hana.cppm guards its include under the same condition. +hana guard boost::hana::experimental::type_name if defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC) -- boost/hana/experimental/type_name.hpp #errors outside BOOST_HANA_CONFIG_CLANG and BOOST_HANA_CONFIG_GCC (no MSVC support); src/hana.cppm guards its include under the same condition. hana unreachable boost::fusion::deque -- Boost.Fusion is include-only (docs/usage.md §2.3). Hana's adaptor boost/hana/ext/boost/fusion/deque.hpp specializes hana's customization points for it and does not re-publish it; the generator before #1 listed it here through a specialization. Hana's own example includes for the type, and so does a program that imports the module. heap unreachable boost::mpl::lambda -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. heap unreachable boost::parameter::optional -- Boost.Parameter is include-only (docs/usage.md §2.3): no module owns its names. This library's headers use it to build their own named parameters, which are exported; its documentation, examples and tests in the 1.92.0 release never make a user spell this one (accumulators' reference shows keyword only as the type of static members). The generator before #1 listed it here through a specialization; now the first module whose signatures mention keyword (convert) has it, and flyweight, the first for the others, drops it. A program that spells it includes the header. diff --git a/src/hana.cppm b/src/hana.cppm index bb953f29..c68c934c 100644 --- a/src/hana.cppm +++ b/src/hana.cppm @@ -3,7 +3,10 @@ module; #include #include +// boost/hana/experimental/type_name.hpp #errors outside Clang/GCC (no MSVC support). +#if defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC) #include +#endif #include #include #include diff --git a/tools/export_policy.toml b/tools/export_policy.toml index ca73b7dc..cdd34ec0 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -1170,6 +1170,23 @@ names = [ "boost::proto::detail::template_arity_impl2", ] +# -------------------------------------------------------------------------- +# hana + +[[hana.guard]] +if = "defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC)" +reason = ''' +boost/hana/experimental/type_name.hpp #errors outside BOOST_HANA_CONFIG_CLANG +and BOOST_HANA_CONFIG_GCC (no MSVC support); src/hana.cppm guards its include +under the same condition. +''' +names = [ + "boost::hana::experimental::type_name", + "boost::hana::experimental::detail::cstring", + "boost::hana::experimental::detail::type_name_impl1", + "boost::hana::experimental::detail::type_name_impl2", +] + # -------------------------------------------------------------------------- # hof From c4a5383e66287388053eb665b8e10fac7c95a35d Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Fri, 4 Dec 2026 08:29:14 +0000 Subject: [PATCH 03/21] fix(type_traits,variant): guard BOOST_MSVC-divergent exports --- generated/exports/type_traits.inc | 31 +++++++++ generated/exports/variant.inc | 21 ++++++ generated/meta/skipped.txt | 23 +++++++ tools/export_policy.toml | 106 ++++++++++++++++++++++++++++++ 4 files changed, 181 insertions(+) diff --git a/generated/exports/type_traits.inc b/generated/exports/type_traits.inc index 056ffa4e..5de74d49 100644 --- a/generated/exports/type_traits.inc +++ b/generated/exports/type_traits.inc @@ -338,8 +338,18 @@ export namespace boost { namespace detail { using boost::detail::empty_helper_t1; using boost::detail::empty_helper_t2; using boost::detail::extent_imp; +#if !defined(BOOST_IS_NOTHROW_MOVE_ASSIGN) + // boost/type_traits/is_nothrow_move_assignable.hpp takes the + // BOOST_IS_NOTHROW_MOVE_ASSIGN intrinsic branch on MSVC and does not declare + // this helper. using boost::detail::false_or_cpp11_noexcept_move_assignable; +#endif +#if !defined(BOOST_IS_NOTHROW_MOVE_CONSTRUCT) + // boost/type_traits/is_nothrow_move_constructible.hpp takes the + // BOOST_IS_NOTHROW_MOVE_CONSTRUCT intrinsic branch on MSVC and does not declare + // this helper. using boost::detail::false_or_cpp11_noexcept_move_constructible; +#endif using boost::detail::function_traits_helper; using boost::detail::has_new_operator_impl; using boost::detail::has_nothrow_destructor_imp; @@ -380,9 +390,18 @@ export namespace boost { namespace detail { namespace aligned_storage { }}} export namespace boost { namespace mpl { +#if !defined(BOOST_MSVC) && !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) + // boost/type_traits/integral_constant.hpp declares bool_, integral_c and + // integral_c_tag directly in boost::mpl under BOOST_MSVC or + // BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE (no ::mpl_ barrier namespace). using ::mpl_::bool_; using ::mpl_::integral_c; using ::mpl_::integral_c_tag; +#else + using boost::mpl::bool_; + using boost::mpl::integral_c; + using boost::mpl::integral_c_tag; +#endif }} export namespace boost { namespace noncopyable_ { @@ -400,9 +419,17 @@ export namespace boost { namespace tr1 { namespace detail { export namespace boost { namespace tt_align_ns { using boost::tt_align_ns::a128; using boost::tt_align_ns::a16; +#if (defined(__GNUC__) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS) + // boost/type_traits/type_with_alignment.hpp declares a2 and a4 only in the + // GCC/Clang __attribute__((aligned)) branch; the MSVC branch starts at a8. using boost::tt_align_ns::a2; +#endif using boost::tt_align_ns::a32; +#if (defined(__GNUC__) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS) + // boost/type_traits/type_with_alignment.hpp declares a2 and a4 only in the + // GCC/Clang __attribute__((aligned)) branch; the MSVC branch starts at a8. using boost::tt_align_ns::a4; +#endif using boost::tt_align_ns::a64; using boost::tt_align_ns::a8; }} @@ -424,7 +451,11 @@ export namespace boost { namespace type_traits { namespace detail { using boost::type_traits::detail::promote_from_index; using boost::type_traits::detail::promoted_index; using boost::type_traits::detail::promoted_index_tester; +#if !defined(BOOST_MSVC) + // boost/type_traits/integral_promotion.hpp declares sized_type_for_promotion + // only under !defined(BOOST_MSVC). using boost::type_traits::detail::sized_type_for_promotion; +#endif }}} export namespace boost { namespace type_traits_detail { diff --git a/generated/exports/variant.inc b/generated/exports/variant.inc index 761d5510..1bf241ea 100644 --- a/generated/exports/variant.inc +++ b/generated/exports/variant.inc @@ -128,6 +128,10 @@ export namespace boost { namespace detail { namespace variant { }}} export namespace boost { namespace mpl { +#if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) + // boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE + // under BOOST_MSVC and declares these symbols directly in boost::mpl rather than + // ::mpl_. using ::mpl_::_; using ::mpl_::_1; using ::mpl_::_2; @@ -143,6 +147,23 @@ export namespace boost { namespace mpl { using ::mpl_::size_t; using ::mpl_::true_; using ::mpl_::void_; +#else + using boost::mpl::_; + using boost::mpl::_1; + using boost::mpl::_2; + using boost::mpl::_3; + using boost::mpl::_4; + using boost::mpl::_5; + using boost::mpl::_6; + using boost::mpl::arg; + using boost::mpl::false_; + using boost::mpl::int_; + using boost::mpl::long_; + using boost::mpl::na; + using boost::mpl::size_t; + using boost::mpl::true_; + using boost::mpl::void_; +#endif using boost::mpl::O1_size; using boost::mpl::O1_size_impl; using boost::mpl::advance; diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index 22fa3f4f..ff943c22 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -811,6 +811,14 @@ thread guard boost::this_thread::no_interruption_point::non_interruptible_wait i tuple guard boost::tuples::detail::ignore_t if !defined(__GNUC__) -- M3 hand-guard: ignore_t is a member-pointer typedef; gcc treats it as internal linkage. type_erasure unreachable boost::mpl::aux::template_arity -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. type_erasure unreachable boost::mpl::lambda -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. +type_traits guard ::mpl_::bool_ if !defined(BOOST_MSVC) && !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/type_traits/integral_constant.hpp declares bool_, integral_c and integral_c_tag directly in boost::mpl under BOOST_MSVC or BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE (no ::mpl_ barrier namespace). +type_traits guard ::mpl_::integral_c if !defined(BOOST_MSVC) && !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/type_traits/integral_constant.hpp declares bool_, integral_c and integral_c_tag directly in boost::mpl under BOOST_MSVC or BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE (no ::mpl_ barrier namespace). +type_traits guard ::mpl_::integral_c_tag if !defined(BOOST_MSVC) && !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/type_traits/integral_constant.hpp declares bool_, integral_c and integral_c_tag directly in boost::mpl under BOOST_MSVC or BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE (no ::mpl_ barrier namespace). +type_traits guard boost::detail::false_or_cpp11_noexcept_move_assignable if !defined(BOOST_IS_NOTHROW_MOVE_ASSIGN) -- boost/type_traits/is_nothrow_move_assignable.hpp takes the BOOST_IS_NOTHROW_MOVE_ASSIGN intrinsic branch on MSVC and does not declare this helper. +type_traits guard boost::detail::false_or_cpp11_noexcept_move_constructible if !defined(BOOST_IS_NOTHROW_MOVE_CONSTRUCT) -- boost/type_traits/is_nothrow_move_constructible.hpp takes the BOOST_IS_NOTHROW_MOVE_CONSTRUCT intrinsic branch on MSVC and does not declare this helper. +type_traits guard boost::tt_align_ns::a2 if (defined(__GNUC__) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS) -- boost/type_traits/type_with_alignment.hpp declares a2 and a4 only in the GCC/Clang __attribute__((aligned)) branch; the MSVC branch starts at a8. +type_traits guard boost::tt_align_ns::a4 if (defined(__GNUC__) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS) -- boost/type_traits/type_with_alignment.hpp declares a2 and a4 only in the GCC/Clang __attribute__((aligned)) branch; the MSVC branch starts at a8. +type_traits guard boost::type_traits::detail::sized_type_for_promotion if !defined(BOOST_MSVC) -- boost/type_traits/integral_promotion.hpp declares sized_type_for_promotion only under !defined(BOOST_MSVC). units unreachable boost::mpl::aux::template_arity -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. units unreachable boost::mpl::deref -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. units unreachable boost::mpl::lambda -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. @@ -837,6 +845,21 @@ uuid guard boost::uuids::detail::to_chars_simd if defined(BOOST_UUID_USE_SSE2) - uuid guard boost::uuids::detail::to_chars_simd_char_constants if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. uuid guard boost::uuids::detail::to_chars_simd_constants if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. uuid guard boost::uuids::detail::to_chars_simd_core if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. +variant guard ::mpl_::_ if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::_1 if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::_2 if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::_3 if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::_4 if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::_5 if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::_6 if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::arg if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::false_ if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::int_ if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::long_ if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::na if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::size_t if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::true_ if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. +variant guard ::mpl_::void_ if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE under BOOST_MSVC and declares these symbols directly in boost::mpl rather than ::mpl_. variant guard boost::mpl::aux::arity_helper if defined(__GNUC__) -- M3 hand-guard: gcc-preprocessed mpl headers only (BOOST_MPL_CFG_COMPILER_DIR=gcc). variant guard boost::mpl::aux::arity_tag if defined(__GNUC__) -- M3 hand-guard: gcc-preprocessed mpl headers only (BOOST_MPL_CFG_COMPILER_DIR=gcc). variant guard boost::mpl::aux::max_arity if defined(__GNUC__) -- M3 hand-guard: as above (max_arity). diff --git a/tools/export_policy.toml b/tools/export_policy.toml index cdd34ec0..9201e367 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -2636,6 +2636,70 @@ names = [ "boost::tuples::detail::ignore_t", ] +# -------------------------------------------------------------------------- +# type_traits + +[[type_traits.guard]] +if = "!defined(BOOST_IS_NOTHROW_MOVE_ASSIGN)" +reason = ''' +boost/type_traits/is_nothrow_move_assignable.hpp takes the +BOOST_IS_NOTHROW_MOVE_ASSIGN intrinsic branch on MSVC and does not declare +this helper. +''' +names = [ + "boost::detail::false_or_cpp11_noexcept_move_assignable", +] + +[[type_traits.guard]] +if = "!defined(BOOST_IS_NOTHROW_MOVE_CONSTRUCT)" +reason = ''' +boost/type_traits/is_nothrow_move_constructible.hpp takes the +BOOST_IS_NOTHROW_MOVE_CONSTRUCT intrinsic branch on MSVC and does not declare +this helper. +''' +names = [ + "boost::detail::false_or_cpp11_noexcept_move_constructible", +] + +[[type_traits.guard]] +if = "!defined(BOOST_MSVC) && !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE)" +reason = ''' +boost/type_traits/integral_constant.hpp declares bool_, integral_c and +integral_c_tag directly in boost::mpl under BOOST_MSVC or +BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE (no ::mpl_ barrier namespace). +''' +names = [ + "::mpl_::bool_", + "::mpl_::integral_c", + "::mpl_::integral_c_tag", +] +else = [ + "using boost::mpl::bool_;", + "using boost::mpl::integral_c;", + "using boost::mpl::integral_c_tag;", +] + +[[type_traits.guard]] +if = "(defined(__GNUC__) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS)" +reason = ''' +boost/type_traits/type_with_alignment.hpp declares a2 and a4 only in the +GCC/Clang __attribute__((aligned)) branch; the MSVC branch starts at a8. +''' +names = [ + "boost::tt_align_ns::a2", + "boost::tt_align_ns::a4", +] + +[[type_traits.guard]] +if = "!defined(BOOST_MSVC)" +reason = ''' +boost/type_traits/integral_promotion.hpp declares sized_type_for_promotion +only under !defined(BOOST_MSVC). +''' +names = [ + "boost::type_traits::detail::sized_type_for_promotion", +] + # -------------------------------------------------------------------------- # url @@ -2718,6 +2782,48 @@ names = [ "boost::mpl::aux::template_arity_impl", ] +[[variant.guard]] +if = "!defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE)" +reason = ''' +boost/mpl/aux_/adl_barrier.hpp defines BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE +under BOOST_MSVC and declares these symbols directly in boost::mpl rather than +::mpl_. +''' +names = [ + "::mpl_::_", + "::mpl_::_1", + "::mpl_::_2", + "::mpl_::_3", + "::mpl_::_4", + "::mpl_::_5", + "::mpl_::_6", + "::mpl_::arg", + "::mpl_::false_", + "::mpl_::int_", + "::mpl_::long_", + "::mpl_::na", + "::mpl_::size_t", + "::mpl_::true_", + "::mpl_::void_", +] +else = [ + "using boost::mpl::_;", + "using boost::mpl::_1;", + "using boost::mpl::_2;", + "using boost::mpl::_3;", + "using boost::mpl::_4;", + "using boost::mpl::_5;", + "using boost::mpl::_6;", + "using boost::mpl::arg;", + "using boost::mpl::false_;", + "using boost::mpl::int_;", + "using boost::mpl::long_;", + "using boost::mpl::na;", + "using boost::mpl::size_t;", + "using boost::mpl::true_;", + "using boost::mpl::void_;", +] + # -------------------------------------------------------------------------- # names modules no longer reach (tools/ci/check_reachable.py) From a3401a0598d0144886051f9b99a4d0f86dfbaa8e Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Fri, 4 Dec 2026 08:35:09 +0000 Subject: [PATCH 04/21] fix(concept_check): guard BOOST_MSVC-divergent exports --- generated/exports/concept_check.inc | 32 +++++++++++++++++ generated/meta/skipped.txt | 14 ++++++++ tools/export_policy.toml | 54 +++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) diff --git a/generated/exports/concept_check.inc b/generated/exports/concept_check.inc index dec11d72..b0fb079f 100644 --- a/generated/exports/concept_check.inc +++ b/generated/exports/concept_check.inc @@ -128,10 +128,16 @@ export namespace boost { using boost::boolean_archetype; using boost::comparable_archetype; using boost::concept_check; +#if !defined(BOOST_MSVC) + // Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp + // instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP + // (sharing the include guard of boost/concept_check/general.hpp), so these + // general-branch symbols are not declared. using boost::concept_check_; using boost::concept_check_failed; using boost::constraint_check; using boost::constraint_check_failed; +#endif using boost::convertible_from_archetype; using boost::convertible_to_archetype; using boost::copy_constructible_archetype; @@ -204,26 +210,52 @@ export namespace boost { } export namespace boost { namespace concept_checking { +#if !defined(BOOST_MSVC) + // Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp + // instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP + // (sharing the include guard of boost/concept_check/general.hpp), so these + // general-branch symbols are not declared. using boost::concept_checking::has_constraints; using boost::concept_checking::has_constraints_; using boost::concept_checking::instantiate; using boost::concept_checking::no; using boost::concept_checking::wrap_constraints; using boost::concept_checking::yes; +#endif }} export namespace boost { namespace concepts { +#if !defined(BOOST_MSVC) + // Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp + // instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP + // (sharing the include guard of boost/concept_check/general.hpp), so these + // general-branch symbols are not declared. using boost::concepts::constraint; +#endif using boost::concepts::failed; using boost::concepts::not_satisfied; +#if !defined(BOOST_MSVC) + // Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp + // which declares check, require and require_ instead of requirement and requirement_. using boost::concepts::requirement; using boost::concepts::requirement_; +#else + using boost::concepts::check; + using boost::concepts::require; + using boost::concepts::require_; +#endif using boost::concepts::usage_requirements; }} export namespace boost { namespace concepts { namespace detail { using boost::concepts::detail::has_constraints_; +#if !defined(BOOST_MSVC) + // Under BOOST_MSVC, boost/concept/detail/msvc.hpp declares + // boost::concepts::detail::constraint instead of instantiate. using boost::concepts::detail::instantiate; +#else + using boost::concepts::detail::constraint; +#endif using boost::concepts::detail::no; using boost::concepts::detail::wrap_constraints; using boost::concepts::detail::yes; diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index ff943c22..4c045b94 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -112,6 +112,20 @@ cobalt skip-directive boost::cobalt::this_coro using boost::asio::this_coro -- ` cobalt unreachable boost::cobalt::detail::main_promise -- boost/cobalt/main.hpp defines the program's main to run the user's co_main, so the module does not include it: the definition would reach every importer. A program written with co_main includes the header itself, before the import (docs/usage.md §6, tests/cobalt/co_main.cpp). cobalt unreachable boost::cobalt::detail::signal_helper -- boost/cobalt/main.hpp defines the program's main to run the user's co_main, so the module does not include it: the definition would reach every importer. A program written with co_main includes the header itself, before the import (docs/usage.md §6, tests/cobalt/co_main.cpp). cobalt unreachable boost::cobalt::main -- boost/cobalt/main.hpp defines the program's main to run the user's co_main, so the module does not include it: the definition would reach every importer. A program written with co_main includes the header itself, before the import (docs/usage.md §6, tests/cobalt/co_main.cpp). +concept_check guard boost::concept_check_ if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::concept_check_failed if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::concept_checking::has_constraints if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::concept_checking::has_constraints_ if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::concept_checking::instantiate if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::concept_checking::no if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::concept_checking::wrap_constraints if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::concept_checking::yes if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::concepts::constraint if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::concepts::detail::instantiate if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/detail/msvc.hpp declares boost::concepts::detail::constraint instead of instantiate. +concept_check guard boost::concepts::requirement if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp which declares check, require and require_ instead of requirement and requirement_. +concept_check guard boost::concepts::requirement_ if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp which declares check, require and require_ instead of requirement and requirement_. +concept_check guard boost::constraint_check if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. +concept_check guard boost::constraint_check_failed if !defined(BOOST_MSVC) -- Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP (sharing the include guard of boost/concept_check/general.hpp), so these general-branch symbols are not declared. config guard boost::int128_type if defined(BOOST_HAS_INT128) -- M3 hand-guard (M9: moved to config.inc): suffix.hpp defines int128_type only where BOOST_HAS_INT128. config guard boost::uint128_type if defined(BOOST_HAS_INT128) -- M3 hand-guard (M9: moved to config.inc): suffix.hpp defines uint128_type only where BOOST_HAS_INT128. container extra -- allocator_traits::construct places elements with the global operator new(std::size_t, void*, boost_container_new_t) of boost/container/detail/placement_new.hpp. A consumer TU that instantiates it (pmr::vector::resize, in the json documentation) looks the operator up at the point of instantiation, where only exported declarations are visible; the generator exports boost:: names only, so the tag type and its placement operators are exported here. gcc only: on clang the using-declarations re-export every global operator new, and libc++'s own aligned allocations in another module's instantiations become ambiguous (`call to 'operator new' is ambiguous`, tests/statechart.cpp); clang reaches the operator through src/json.cppm instead. diff --git a/tools/export_policy.toml b/tools/export_policy.toml index 9201e367..db4c664d 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -856,6 +856,60 @@ names = [ "boost::uint128_type", ] +# -------------------------------------------------------------------------- +# concept_check + +[[concept_check.guard]] +if = "!defined(BOOST_MSVC)" +reason = ''' +Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp +instead of general.hpp, which defines BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP +(sharing the include guard of boost/concept_check/general.hpp), so these +general-branch symbols are not declared. +''' +names = [ + "boost::concept_check_", + "boost::concept_check_failed", + "boost::constraint_check", + "boost::constraint_check_failed", + "boost::concept_checking::has_constraints", + "boost::concept_checking::has_constraints_", + "boost::concept_checking::instantiate", + "boost::concept_checking::no", + "boost::concept_checking::wrap_constraints", + "boost::concept_checking::yes", + "boost::concepts::constraint", +] + +[[concept_check.guard]] +if = "!defined(BOOST_MSVC)" +reason = ''' +Under BOOST_MSVC, boost/concept/assert.hpp includes boost/concept/detail/msvc.hpp +which declares check, require and require_ instead of requirement and requirement_. +''' +names = [ + "boost::concepts::requirement", + "boost::concepts::requirement_", +] +else = [ + "using boost::concepts::check;", + "using boost::concepts::require;", + "using boost::concepts::require_;", +] + +[[concept_check.guard]] +if = "!defined(BOOST_MSVC)" +reason = ''' +Under BOOST_MSVC, boost/concept/detail/msvc.hpp declares +boost::concepts::detail::constraint instead of instantiate. +''' +names = [ + "boost::concepts::detail::instantiate", +] +else = [ + "using boost::concepts::detail::constraint;", +] + # -------------------------------------------------------------------------- # container From 280ae791cf533c496aa1e4fae0ba934ffe4bed1e Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Fri, 4 Dec 2026 08:46:50 +0000 Subject: [PATCH 05/21] fix(algorithm,math): guard is_blank and disambiguate differentiation::detail on MSVC --- generated/exports/algorithm.inc | 10 + generated/exports/math.inc | 5 + generated/meta/skipped.txt | 9 + patches/math.patch | 196 ++++++++++++++++++ tools/export_policy.toml | 32 +++ .../differentiation/finite_difference.hpp | 27 ++- .../differentiation/lanczos_smoothing.hpp | 29 ++- .../boost/math/tools/condition_numbers.hpp | 2 +- 8 files changed, 292 insertions(+), 18 deletions(-) diff --git a/generated/exports/algorithm.inc b/generated/exports/algorithm.inc index 235cb52d..d83386d1 100644 --- a/generated/exports/algorithm.inc +++ b/generated/exports/algorithm.inc @@ -73,7 +73,12 @@ export namespace boost { using boost::is_alnum; using boost::is_alpha; using boost::is_any_of; +#if !defined(BOOST_NO_CXX11) + // boost/algorithm/string/classification.hpp declares is_blank only under + // !defined(BOOST_NO_CXX11) (which Boost.Config defines on MSVC via + // BOOST_NO_COMPLETE_VALUE_INITIALIZATION -> BOOST_NO_CXX03 -> BOOST_NO_CXX11). using boost::is_blank; +#endif using boost::is_classified; using boost::is_cntrl; using boost::is_digit; @@ -269,7 +274,12 @@ export namespace boost { namespace algorithm { using boost::algorithm::is_alnum; using boost::algorithm::is_alpha; using boost::algorithm::is_any_of; +#if !defined(BOOST_NO_CXX11) + // boost/algorithm/string/classification.hpp declares is_blank only under + // !defined(BOOST_NO_CXX11) (which Boost.Config defines on MSVC via + // BOOST_NO_COMPLETE_VALUE_INITIALIZATION -> BOOST_NO_CXX03 -> BOOST_NO_CXX11). using boost::algorithm::is_blank; +#endif using boost::algorithm::is_clamped; using boost::algorithm::is_classified; using boost::algorithm::is_cntrl; diff --git a/generated/exports/math.inc b/generated/exports/math.inc index 47d09414..044036b7 100644 --- a/generated/exports/math.inc +++ b/generated/exports/math.inc @@ -1840,6 +1840,10 @@ export namespace boost { namespace math { namespace differentiation { namespace }}}}} export namespace boost { namespace math { namespace differentiation { namespace detail { +#if !defined(BOOST_MSVC) + // Under BOOST_MSVC, patches/math.patch moves lanczos_smoothing.hpp and + // finite_difference.hpp detail helpers to boost::math::differentiation::diff_detail + // to avoid C2872 ambiguity with inline namespace autodiff_v1::detail. using boost::math::differentiation::detail::acceleration_filter; using boost::math::differentiation::detail::boundary_velocity_filter; using boost::math::differentiation::detail::discrete_legendre; @@ -1847,6 +1851,7 @@ export namespace boost { namespace math { namespace differentiation { namespace using boost::math::differentiation::detail::finite_difference_derivative; using boost::math::differentiation::detail::interior_velocity_filter; using boost::math::differentiation::detail::make_xph_representable; +#endif }}}} export namespace boost { namespace math { namespace differentiation { namespace reverse_mode { diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index 4c045b94..b70b218e 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -11,6 +11,8 @@ accumulators unreachable boost::mpl::aux::template_arity -- Boost.MPL is include accumulators unreachable boost::mpl::insert -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. accumulators unreachable boost::mpl::lambda -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. accumulators unreachable boost::parameter::keyword -- Boost.Parameter is include-only (docs/usage.md §2.3): no module owns its names. This library's headers use it to build their own named parameters, which are exported; its documentation, examples and tests in the 1.92.0 release never make a user spell this one (accumulators' reference shows keyword only as the type of static members). The generator before #1 listed it here through a specialization; now the first module whose signatures mention keyword (convert) has it, and flyweight, the first for the others, drops it. A program that spells it includes the header. +algorithm guard boost::algorithm::is_blank if !defined(BOOST_NO_CXX11) -- boost/algorithm/string/classification.hpp declares is_blank only under !defined(BOOST_NO_CXX11) (which Boost.Config defines on MSVC via BOOST_NO_COMPLETE_VALUE_INITIALIZATION -> BOOST_NO_CXX03 -> BOOST_NO_CXX11). +algorithm guard boost::is_blank if !defined(BOOST_NO_CXX11) -- boost/algorithm/string/classification.hpp declares is_blank only under !defined(BOOST_NO_CXX11) (which Boost.Config defines on MSVC via BOOST_NO_COMPLETE_VALUE_INITIALIZATION -> BOOST_NO_CXX03 -> BOOST_NO_CXX11). align drop boost::alignment::detail::alignment_of -- boost::alignment::detail::alignment_of is `using std::alignment_of` only on some compilers; other targets (clang outside x86_64) define a template of that name, which the std re-export would conflict with. asio extra boost::asio::socket_errc -- Like boost::asio::stream_errc: boost/asio/error.hpp simulates the proposed socket_errc scoped enum with a namespace of using-declarations of error:: enumerators, re-created here. asio extra boost::asio::stream_errc -- boost/asio/error.hpp simulates the proposed stream_errc / socket_errc scoped enums with namespaces that hold only using-declarations of error:: enumerators (the cpp14 blocking_tcp_echo_server example compares with boost::asio::stream_errc::eof). The generator collects declared entities, not using-declarations, so those namespaces are re-created here. @@ -526,6 +528,13 @@ lockfree unreachable boost::parameter::parameters -- Boost.Parameter is include- math guard boost::float80_t if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 -- M11 platform guard: cstdfloat_types.hpp declares the 80-bit long-double typedefs only where long double really is 80-bit; MSVC long double is 53-bit. math guard boost::float_fast80_t if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 -- M11 platform guard: cstdfloat_types.hpp declares the 80-bit long-double typedefs only where long double really is 80-bit; MSVC long double is 53-bit. math guard boost::float_least80_t if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 -- M11 platform guard: cstdfloat_types.hpp declares the 80-bit long-double typedefs only where long double really is 80-bit; MSVC long double is 53-bit. +math guard boost::math::differentiation::detail::acceleration_filter if !defined(BOOST_MSVC) -- Under BOOST_MSVC, patches/math.patch moves lanczos_smoothing.hpp and finite_difference.hpp detail helpers to boost::math::differentiation::diff_detail to avoid C2872 ambiguity with inline namespace autodiff_v1::detail. +math guard boost::math::differentiation::detail::boundary_velocity_filter if !defined(BOOST_MSVC) -- Under BOOST_MSVC, patches/math.patch moves lanczos_smoothing.hpp and finite_difference.hpp detail helpers to boost::math::differentiation::diff_detail to avoid C2872 ambiguity with inline namespace autodiff_v1::detail. +math guard boost::math::differentiation::detail::discrete_legendre if !defined(BOOST_MSVC) -- Under BOOST_MSVC, patches/math.patch moves lanczos_smoothing.hpp and finite_difference.hpp detail helpers to boost::math::differentiation::diff_detail to avoid C2872 ambiguity with inline namespace autodiff_v1::detail. +math guard boost::math::differentiation::detail::fd_tag if !defined(BOOST_MSVC) -- Under BOOST_MSVC, patches/math.patch moves lanczos_smoothing.hpp and finite_difference.hpp detail helpers to boost::math::differentiation::diff_detail to avoid C2872 ambiguity with inline namespace autodiff_v1::detail. +math guard boost::math::differentiation::detail::finite_difference_derivative if !defined(BOOST_MSVC) -- Under BOOST_MSVC, patches/math.patch moves lanczos_smoothing.hpp and finite_difference.hpp detail helpers to boost::math::differentiation::diff_detail to avoid C2872 ambiguity with inline namespace autodiff_v1::detail. +math guard boost::math::differentiation::detail::interior_velocity_filter if !defined(BOOST_MSVC) -- Under BOOST_MSVC, patches/math.patch moves lanczos_smoothing.hpp and finite_difference.hpp detail helpers to boost::math::differentiation::diff_detail to avoid C2872 ambiguity with inline namespace autodiff_v1::detail. +math guard boost::math::differentiation::detail::make_xph_representable if !defined(BOOST_MSVC) -- Under BOOST_MSVC, patches/math.patch moves lanczos_smoothing.hpp and finite_difference.hpp detail helpers to boost::math::differentiation::diff_detail to avoid C2872 ambiguity with inline namespace autodiff_v1::detail. math guard boost::math::statistics::detail::chatterjee_correlation_par_impl if defined(BOOST_MATH_EXEC_COMPATIBLE) -- M11 CI platform guard: statistics chatterjee_correlation_par_impl is defined only under BOOST_MATH_EXEC_COMPATIBLE (chatterjee_correlation.hpp / bivariate_statistics.hpp); libc++ lacks __cpp_lib_execution. math guard boost::math::statistics::detail::correlation_coefficient_parallel_impl if defined(BOOST_MATH_EXEC_COMPATIBLE) -- M11 CI platform guard: statistics correlation_coefficient_parallel_impl is defined only under BOOST_MATH_EXEC_COMPATIBLE (chatterjee_correlation.hpp / bivariate_statistics.hpp); libc++ lacks __cpp_lib_execution. math guard boost::math::statistics::detail::means_and_covariance_parallel_impl if defined(BOOST_MATH_EXEC_COMPATIBLE) -- M11 CI platform guard: statistics means_and_covariance_parallel_impl is defined only under BOOST_MATH_EXEC_COMPATIBLE (chatterjee_correlation.hpp / bivariate_statistics.hpp); libc++ lacks __cpp_lib_execution. diff --git a/patches/math.patch b/patches/math.patch index 0fe17cc2..d1bfdb29 100644 --- a/patches/math.patch +++ b/patches/math.patch @@ -110,3 +110,199 @@ index 1097ad5c..8ed4d715 100644 std::array roots = {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; +diff --git a/upstream/boost/boost/math/differentiation/finite_difference.hpp b/upstream/boost/boost/math/differentiation/finite_difference.hpp +index 1375bac7..b2fc9ea8 100644 +--- a/upstream/boost/boost/math/differentiation/finite_difference.hpp ++++ b/upstream/boost/boost/math/differentiation/finite_difference.hpp +@@ -49,7 +49,18 @@ + + namespace boost{ namespace math{ namespace differentiation { + +-namespace detail { ++// boost-m vendored edit: avoid MSVC C2872 ambiguity between ++// boost::math::differentiation::detail and inline namespace autodiff_v1::detail ++// when autodiff.hpp and finite_difference.hpp share a module GMF. ++#ifndef BOOST_MATH_DIFF_DETAIL_NS ++# ifdef BOOST_MSVC ++# define BOOST_MATH_DIFF_DETAIL_NS diff_detail ++# else ++# define BOOST_MATH_DIFF_DETAIL_NS detail ++# endif ++#endif ++ ++namespace BOOST_MATH_DIFF_DETAIL_NS { + template + Real make_xph_representable(Real x, Real h) + { +@@ -81,7 +92,7 @@ Real complex_step_derivative(const F f, Real x) + return f(complex(x, step)).imag()*inv_step; + } + +-namespace detail { ++namespace BOOST_MATH_DIFF_DETAIL_NS { + + template + struct fd_tag {}; +@@ -100,7 +111,7 @@ namespace detail { + // Since this factor is invariant under the scaling f -> kf, then we are somewhat justified in approximating it by 1. + // This approximation will get better as we move to higher orders of accuracy. + Real h = 2 * sqrt(eps); +- h = detail::make_xph_representable(x, h); ++ h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); + + Real yh = f(x + h); + Real y0 = f(x); +@@ -128,7 +139,7 @@ namespace detail { + // See the previous discussion to understand determination of h and the error bound. + // Series[(f[x+h] - f[x-h])/(2*h), {h, 0, 4}] + Real h = pow(3 * eps, static_cast(1) / static_cast(3)); +- h = detail::make_xph_representable(x, h); ++ h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); + + Real yh = f(x + h); + Real ymh = f(x - h); +@@ -154,7 +165,7 @@ namespace detail { + const Real eps = (numeric_limits::epsilon)(); + // Error bound ~eps^4/5 + Real h = pow(Real(11.25)*eps, static_cast(1) / static_cast(5)); +- h = detail::make_xph_representable(x, h); ++ h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); + Real ymth = f(x - 2 * h); + Real yth = f(x + 2 * h); + Real yh = f(x + h); +@@ -187,7 +198,7 @@ namespace detail { + // Error bound ~eps^6/7 + // Error: h^6f^(7)(x)/140 + 5|f(x)|eps/h + Real h = pow(eps / 168, static_cast(1) / static_cast(7)); +- h = detail::make_xph_representable(x, h); ++ h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); + + Real yh = f(x + h); + Real ymh = f(x - h); +@@ -223,7 +234,7 @@ namespace detail { + // Series[(f[x+h]-f[x-h])*(4/5) + (1/5)*(f[x-2*h] - f[x+2*h]) + (4/105)*(f[x+3*h] - f[x-3*h]) + (1/280)*(f[x-4*h] - f[x+4*h]), {h, 0, 9}] + // If we used Kahan summation, we could get the max error down to h^8|f^(9)(x)|/630 + |f(x)|eps/h. + Real h = pow(Real(551.25)*eps, static_cast(1) / static_cast(9)); +- h = detail::make_xph_representable(x, h); ++ h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); + + Real yh = f(x + h); + Real ymh = f(x - h); +@@ -259,7 +270,7 @@ namespace detail { + template + inline Real finite_difference_derivative(const F f, Real x, Real* error = nullptr) + { +- return detail::finite_difference_derivative(f, x, error, detail::fd_tag()); ++ return BOOST_MATH_DIFF_DETAIL_NS::finite_difference_derivative(f, x, error, BOOST_MATH_DIFF_DETAIL_NS::fd_tag()); + } + + }}} // namespaces +diff --git a/upstream/boost/boost/math/differentiation/lanczos_smoothing.hpp b/upstream/boost/boost/math/differentiation/lanczos_smoothing.hpp +index 4103f538..a21c299f 100644 +--- a/upstream/boost/boost/math/differentiation/lanczos_smoothing.hpp ++++ b/upstream/boost/boost/math/differentiation/lanczos_smoothing.hpp +@@ -25,7 +25,18 @@ + + namespace boost::math::differentiation { + +-namespace detail { ++// boost-m vendored edit: avoid MSVC C2872 ambiguity between ++// boost::math::differentiation::detail and inline namespace autodiff_v1::detail ++// when autodiff.hpp and lanczos_smoothing.hpp share a module GMF. ++#ifndef BOOST_MATH_DIFF_DETAIL_NS ++# ifdef BOOST_MSVC ++# define BOOST_MATH_DIFF_DETAIL_NS diff_detail ++# else ++# define BOOST_MATH_DIFF_DETAIL_NS detail ++# endif ++#endif ++ ++namespace BOOST_MATH_DIFF_DETAIL_NS { + template + class discrete_legendre { + public: +@@ -274,7 +285,7 @@ public: + + if constexpr (std::is_same_v || std::is_same_v) + { +- auto interior = detail::interior_velocity_filter(n, approximation_order); ++ auto interior = BOOST_MATH_DIFF_DETAIL_NS::interior_velocity_filter(n, approximation_order); + m_f.resize(interior.size()); + for (std::size_t j = 0; j < interior.size(); ++j) + { +@@ -283,7 +294,7 @@ public: + } + else + { +- m_f = detail::interior_velocity_filter(n, approximation_order); ++ m_f = BOOST_MATH_DIFF_DETAIL_NS::interior_velocity_filter(n, approximation_order); + for (auto & x : m_f) + { + x /= m_dt; +@@ -298,7 +309,7 @@ public: + if constexpr (std::is_same_v || std::is_same_v) + { + int64_t s = static_cast(i) - static_cast(n); +- auto bf = detail::boundary_velocity_filter(n, approximation_order, s); ++ auto bf = BOOST_MATH_DIFF_DETAIL_NS::boundary_velocity_filter(n, approximation_order, s); + m_boundary_filters[i].resize(bf.size()); + for (std::size_t j = 0; j < bf.size(); ++j) + { +@@ -308,7 +319,7 @@ public: + else + { + int64_t s = static_cast(i) - static_cast(n); +- m_boundary_filters[i] = detail::boundary_velocity_filter(n, approximation_order, s); ++ m_boundary_filters[i] = BOOST_MATH_DIFF_DETAIL_NS::boundary_velocity_filter(n, approximation_order, s); + for (auto & bf : m_boundary_filters[i]) + { + bf /= m_dt; +@@ -325,7 +336,7 @@ public: + // since the resulting cost is a factor of 2, and the cost of the filters not working is hours of debugging. + if constexpr (std::is_same_v || std::is_same_v) + { +- auto f = detail::acceleration_filter(n, approximation_order, 0); ++ auto f = BOOST_MATH_DIFF_DETAIL_NS::acceleration_filter(n, approximation_order, 0); + m_f.resize(n+1); + for (std::size_t i = 0; i < m_f.size(); ++i) + { +@@ -335,7 +346,7 @@ public: + for (std::size_t i = 0; i < n; ++i) + { + int64_t s = static_cast(i) - static_cast(n); +- auto bf = detail::acceleration_filter(n, approximation_order, s); ++ auto bf = BOOST_MATH_DIFF_DETAIL_NS::acceleration_filter(n, approximation_order, s); + m_boundary_filters[i].resize(bf.size()); + for (std::size_t j = 0; j < bf.size(); ++j) + { +@@ -347,7 +358,7 @@ public: + { + // Given that the purpose is denoising, for higher precision calculations, + // the default precision should be fine. +- auto f = detail::acceleration_filter(n, approximation_order, 0); ++ auto f = BOOST_MATH_DIFF_DETAIL_NS::acceleration_filter(n, approximation_order, 0); + m_f.resize(n+1); + for (std::size_t i = 0; i < m_f.size(); ++i) + { +@@ -357,7 +368,7 @@ public: + for (std::size_t i = 0; i < n; ++i) + { + int64_t s = static_cast(i) - static_cast(n); +- m_boundary_filters[i] = detail::acceleration_filter(n, approximation_order, s); ++ m_boundary_filters[i] = BOOST_MATH_DIFF_DETAIL_NS::acceleration_filter(n, approximation_order, s); + for (auto & bf : m_boundary_filters[i]) + { + bf /= (m_dt*m_dt); +diff --git a/upstream/boost/boost/math/tools/condition_numbers.hpp b/upstream/boost/boost/math/tools/condition_numbers.hpp +index c285b479..3cb1fa60 100644 +--- a/upstream/boost/boost/math/tools/condition_numbers.hpp ++++ b/upstream/boost/boost/math/tools/condition_numbers.hpp +@@ -116,7 +116,7 @@ Real evaluation_condition_number(F const & f, Real const & x) + // Check if a left derivative exists: + const Real eps = (std::numeric_limits::epsilon)(); + Real h = - 2 * sqrt(eps); +- h = boost::math::differentiation::detail::make_xph_representable(x, h); ++ h = boost::math::differentiation::BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); + Real yh = f(x + h); + Real y0 = f(x); + Real diff = yh - y0; diff --git a/tools/export_policy.toml b/tools/export_policy.toml index db4c664d..ca6caf67 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -496,6 +496,21 @@ accumulators::impl::X is spelled upstream only for impl's own accumulator templates, which are exported directly; none goes through the directive. ''' +# -------------------------------------------------------------------------- +# algorithm + +[[algorithm.guard]] +if = "!defined(BOOST_NO_CXX11)" +reason = ''' +boost/algorithm/string/classification.hpp declares is_blank only under +!defined(BOOST_NO_CXX11) (which Boost.Config defines on MSVC via +BOOST_NO_COMPLETE_VALUE_INITIALIZATION -> BOOST_NO_CXX03 -> BOOST_NO_CXX11). +''' +names = [ + "boost::is_blank", + "boost::algorithm::is_blank", +] + # -------------------------------------------------------------------------- # asio @@ -1665,6 +1680,23 @@ lines = [ # -------------------------------------------------------------------------- # math +[[math.guard]] +if = "!defined(BOOST_MSVC)" +reason = ''' +Under BOOST_MSVC, patches/math.patch moves lanczos_smoothing.hpp and +finite_difference.hpp detail helpers to boost::math::differentiation::diff_detail +to avoid C2872 ambiguity with inline namespace autodiff_v1::detail. +''' +names = [ + "boost::math::differentiation::detail::acceleration_filter", + "boost::math::differentiation::detail::boundary_velocity_filter", + "boost::math::differentiation::detail::discrete_legendre", + "boost::math::differentiation::detail::fd_tag", + "boost::math::differentiation::detail::finite_difference_derivative", + "boost::math::differentiation::detail::interior_velocity_filter", + "boost::math::differentiation::detail::make_xph_representable", +] + [[math.guard]] if = "LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384" reason = ''' diff --git a/upstream/boost/boost/math/differentiation/finite_difference.hpp b/upstream/boost/boost/math/differentiation/finite_difference.hpp index 1375bac7..b2fc9ea8 100644 --- a/upstream/boost/boost/math/differentiation/finite_difference.hpp +++ b/upstream/boost/boost/math/differentiation/finite_difference.hpp @@ -49,7 +49,18 @@ namespace boost{ namespace math{ namespace differentiation { -namespace detail { +// boost-m vendored edit: avoid MSVC C2872 ambiguity between +// boost::math::differentiation::detail and inline namespace autodiff_v1::detail +// when autodiff.hpp and finite_difference.hpp share a module GMF. +#ifndef BOOST_MATH_DIFF_DETAIL_NS +# ifdef BOOST_MSVC +# define BOOST_MATH_DIFF_DETAIL_NS diff_detail +# else +# define BOOST_MATH_DIFF_DETAIL_NS detail +# endif +#endif + +namespace BOOST_MATH_DIFF_DETAIL_NS { template Real make_xph_representable(Real x, Real h) { @@ -81,7 +92,7 @@ Real complex_step_derivative(const F f, Real x) return f(complex(x, step)).imag()*inv_step; } -namespace detail { +namespace BOOST_MATH_DIFF_DETAIL_NS { template struct fd_tag {}; @@ -100,7 +111,7 @@ namespace detail { // Since this factor is invariant under the scaling f -> kf, then we are somewhat justified in approximating it by 1. // This approximation will get better as we move to higher orders of accuracy. Real h = 2 * sqrt(eps); - h = detail::make_xph_representable(x, h); + h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); Real yh = f(x + h); Real y0 = f(x); @@ -128,7 +139,7 @@ namespace detail { // See the previous discussion to understand determination of h and the error bound. // Series[(f[x+h] - f[x-h])/(2*h), {h, 0, 4}] Real h = pow(3 * eps, static_cast(1) / static_cast(3)); - h = detail::make_xph_representable(x, h); + h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); Real yh = f(x + h); Real ymh = f(x - h); @@ -154,7 +165,7 @@ namespace detail { const Real eps = (numeric_limits::epsilon)(); // Error bound ~eps^4/5 Real h = pow(Real(11.25)*eps, static_cast(1) / static_cast(5)); - h = detail::make_xph_representable(x, h); + h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); Real ymth = f(x - 2 * h); Real yth = f(x + 2 * h); Real yh = f(x + h); @@ -187,7 +198,7 @@ namespace detail { // Error bound ~eps^6/7 // Error: h^6f^(7)(x)/140 + 5|f(x)|eps/h Real h = pow(eps / 168, static_cast(1) / static_cast(7)); - h = detail::make_xph_representable(x, h); + h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); Real yh = f(x + h); Real ymh = f(x - h); @@ -223,7 +234,7 @@ namespace detail { // Series[(f[x+h]-f[x-h])*(4/5) + (1/5)*(f[x-2*h] - f[x+2*h]) + (4/105)*(f[x+3*h] - f[x-3*h]) + (1/280)*(f[x-4*h] - f[x+4*h]), {h, 0, 9}] // If we used Kahan summation, we could get the max error down to h^8|f^(9)(x)|/630 + |f(x)|eps/h. Real h = pow(Real(551.25)*eps, static_cast(1) / static_cast(9)); - h = detail::make_xph_representable(x, h); + h = BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); Real yh = f(x + h); Real ymh = f(x - h); @@ -259,7 +270,7 @@ namespace detail { template inline Real finite_difference_derivative(const F f, Real x, Real* error = nullptr) { - return detail::finite_difference_derivative(f, x, error, detail::fd_tag()); + return BOOST_MATH_DIFF_DETAIL_NS::finite_difference_derivative(f, x, error, BOOST_MATH_DIFF_DETAIL_NS::fd_tag()); } }}} // namespaces diff --git a/upstream/boost/boost/math/differentiation/lanczos_smoothing.hpp b/upstream/boost/boost/math/differentiation/lanczos_smoothing.hpp index 4103f538..a21c299f 100644 --- a/upstream/boost/boost/math/differentiation/lanczos_smoothing.hpp +++ b/upstream/boost/boost/math/differentiation/lanczos_smoothing.hpp @@ -25,7 +25,18 @@ namespace boost::math::differentiation { -namespace detail { +// boost-m vendored edit: avoid MSVC C2872 ambiguity between +// boost::math::differentiation::detail and inline namespace autodiff_v1::detail +// when autodiff.hpp and lanczos_smoothing.hpp share a module GMF. +#ifndef BOOST_MATH_DIFF_DETAIL_NS +# ifdef BOOST_MSVC +# define BOOST_MATH_DIFF_DETAIL_NS diff_detail +# else +# define BOOST_MATH_DIFF_DETAIL_NS detail +# endif +#endif + +namespace BOOST_MATH_DIFF_DETAIL_NS { template class discrete_legendre { public: @@ -274,7 +285,7 @@ class discrete_lanczos_derivative { if constexpr (std::is_same_v || std::is_same_v) { - auto interior = detail::interior_velocity_filter(n, approximation_order); + auto interior = BOOST_MATH_DIFF_DETAIL_NS::interior_velocity_filter(n, approximation_order); m_f.resize(interior.size()); for (std::size_t j = 0; j < interior.size(); ++j) { @@ -283,7 +294,7 @@ class discrete_lanczos_derivative { } else { - m_f = detail::interior_velocity_filter(n, approximation_order); + m_f = BOOST_MATH_DIFF_DETAIL_NS::interior_velocity_filter(n, approximation_order); for (auto & x : m_f) { x /= m_dt; @@ -298,7 +309,7 @@ class discrete_lanczos_derivative { if constexpr (std::is_same_v || std::is_same_v) { int64_t s = static_cast(i) - static_cast(n); - auto bf = detail::boundary_velocity_filter(n, approximation_order, s); + auto bf = BOOST_MATH_DIFF_DETAIL_NS::boundary_velocity_filter(n, approximation_order, s); m_boundary_filters[i].resize(bf.size()); for (std::size_t j = 0; j < bf.size(); ++j) { @@ -308,7 +319,7 @@ class discrete_lanczos_derivative { else { int64_t s = static_cast(i) - static_cast(n); - m_boundary_filters[i] = detail::boundary_velocity_filter(n, approximation_order, s); + m_boundary_filters[i] = BOOST_MATH_DIFF_DETAIL_NS::boundary_velocity_filter(n, approximation_order, s); for (auto & bf : m_boundary_filters[i]) { bf /= m_dt; @@ -325,7 +336,7 @@ class discrete_lanczos_derivative { // since the resulting cost is a factor of 2, and the cost of the filters not working is hours of debugging. if constexpr (std::is_same_v || std::is_same_v) { - auto f = detail::acceleration_filter(n, approximation_order, 0); + auto f = BOOST_MATH_DIFF_DETAIL_NS::acceleration_filter(n, approximation_order, 0); m_f.resize(n+1); for (std::size_t i = 0; i < m_f.size(); ++i) { @@ -335,7 +346,7 @@ class discrete_lanczos_derivative { for (std::size_t i = 0; i < n; ++i) { int64_t s = static_cast(i) - static_cast(n); - auto bf = detail::acceleration_filter(n, approximation_order, s); + auto bf = BOOST_MATH_DIFF_DETAIL_NS::acceleration_filter(n, approximation_order, s); m_boundary_filters[i].resize(bf.size()); for (std::size_t j = 0; j < bf.size(); ++j) { @@ -347,7 +358,7 @@ class discrete_lanczos_derivative { { // Given that the purpose is denoising, for higher precision calculations, // the default precision should be fine. - auto f = detail::acceleration_filter(n, approximation_order, 0); + auto f = BOOST_MATH_DIFF_DETAIL_NS::acceleration_filter(n, approximation_order, 0); m_f.resize(n+1); for (std::size_t i = 0; i < m_f.size(); ++i) { @@ -357,7 +368,7 @@ class discrete_lanczos_derivative { for (std::size_t i = 0; i < n; ++i) { int64_t s = static_cast(i) - static_cast(n); - m_boundary_filters[i] = detail::acceleration_filter(n, approximation_order, s); + m_boundary_filters[i] = BOOST_MATH_DIFF_DETAIL_NS::acceleration_filter(n, approximation_order, s); for (auto & bf : m_boundary_filters[i]) { bf /= (m_dt*m_dt); diff --git a/upstream/boost/boost/math/tools/condition_numbers.hpp b/upstream/boost/boost/math/tools/condition_numbers.hpp index c285b479..3cb1fa60 100644 --- a/upstream/boost/boost/math/tools/condition_numbers.hpp +++ b/upstream/boost/boost/math/tools/condition_numbers.hpp @@ -116,7 +116,7 @@ Real evaluation_condition_number(F const & f, Real const & x) // Check if a left derivative exists: const Real eps = (std::numeric_limits::epsilon)(); Real h = - 2 * sqrt(eps); - h = boost::math::differentiation::detail::make_xph_representable(x, h); + h = boost::math::differentiation::BOOST_MATH_DIFF_DETAIL_NS::make_xph_representable(x, h); Real yh = f(x + h); Real y0 = f(x); Real diff = yh - y0; From 060138bcc53185388155ff8197b1827402fba8c2 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Fri, 4 Dec 2026 08:55:58 +0000 Subject: [PATCH 06/21] fix(msvc): pass /Zc:__cplusplus and guard boost::units::si::pascal --- generated/exports/units.inc | 4 ++++ generated/meta/skipped.txt | 1 + mcpp.toml | 6 ++++++ tools/export_policy.toml | 13 +++++++++++++ 4 files changed, 24 insertions(+) diff --git a/generated/exports/units.inc b/generated/exports/units.inc index e516ae19..ce825496 100644 --- a/generated/exports/units.inc +++ b/generated/exports/units.inc @@ -820,7 +820,11 @@ export namespace boost { namespace units { namespace si { using boost::units::si::newtons_per_meter; using boost::units::si::ohm; using boost::units::si::ohms; +#if !defined(BOOST_UNITS_NO_PASCAL) + // boost/units/systems/si/pressure.hpp defines BOOST_UNITS_NO_PASCAL under + // BOOST_MSVC and omits boost::units::si::pascal. using boost::units::si::pascal; +#endif using boost::units::si::pascals; using boost::units::si::permeability; using boost::units::si::permittivity; diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index b70b218e..72c4556d 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -842,6 +842,7 @@ type_traits guard boost::detail::false_or_cpp11_noexcept_move_constructible if ! type_traits guard boost::tt_align_ns::a2 if (defined(__GNUC__) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS) -- boost/type_traits/type_with_alignment.hpp declares a2 and a4 only in the GCC/Clang __attribute__((aligned)) branch; the MSVC branch starts at a8. type_traits guard boost::tt_align_ns::a4 if (defined(__GNUC__) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS) -- boost/type_traits/type_with_alignment.hpp declares a2 and a4 only in the GCC/Clang __attribute__((aligned)) branch; the MSVC branch starts at a8. type_traits guard boost::type_traits::detail::sized_type_for_promotion if !defined(BOOST_MSVC) -- boost/type_traits/integral_promotion.hpp declares sized_type_for_promotion only under !defined(BOOST_MSVC). +units guard boost::units::si::pascal if !defined(BOOST_UNITS_NO_PASCAL) -- boost/units/systems/si/pressure.hpp defines BOOST_UNITS_NO_PASCAL under BOOST_MSVC and omits boost::units::si::pascal. units unreachable boost::mpl::aux::template_arity -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. units unreachable boost::mpl::deref -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. units unreachable boost::mpl::lambda -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. diff --git a/mcpp.toml b/mcpp.toml index 5a37ffd2..040d09b2 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -305,6 +305,12 @@ flags = [{ glob = "upstream/boost/libs/thread/src/**", defines = ["BOOST_THREAD_ [target.'cfg(compiler = "llvm")'.build] cxxflags = ["-Wno-invalid-specialization"] +# MSVC leaves __cplusplus at 199711L unless /Zc:__cplusplus is passed, causing +# Boost headers that test __cplusplus (e.g. hana/traits.hpp) to take C++98 +# branches and reference traits removed in C++20 (such as std::is_literal_type). +[target.'cfg(compiler = "msvc")'.build] +cxxflags = ["/Zc:__cplusplus"] + # -- generated by tools/gen_features.py - do not edit -- [features] all-modules = { implies = ["optional", "variant", "variant2", "any", "core", "container-hash", "mp11", "static-string", "scope", "type-traits", "algorithm", "iterator", "range", "io", "rational", "endian", "tuple", "system", "filesystem", "regex", "thread", "chrono", "program-options", "stacktrace", "json", "url", "align", "array", "assert", "assign", "bimap", "bind", "bloom", "callable-traits", "circular-buffer", "compat", "concept-check", "config", "conversion", "convert", "crc", "decimal", "dll", "dynamic-bitset", "flyweight", "format", "function", "functional", "hash2", "heap", "histogram", "hof", "icl", "integer", "intrusive", "lambda", "lambda2", "leaf", "lexical-cast", "lockfree", "logic", "move", "multi-array", "multi-index", "outcome", "parser", "pfr", "poly-collection", "pool", "property-map", "property-tree", "ptr-container", "ratio", "safe-numerics", "signals2", "smart-ptr", "sort", "statechart", "stl-interfaces", "throw-exception", "tokenizer", "type-index", "units", "unordered", "utility", "uuid", "winapi", "yap", "atomic", "charconv", "cobalt", "container", "contract", "date-time", "graph", "iostreams", "math", "nowide", "process", "random", "serialization", "timer", "type-erasure", "wave", "accumulators", "asio", "beast", "geometry", "gil", "hana", "interprocess", "mqtt5", "multiprecision", "numeric", "polygon", "qvm", "version", "macros"] } diff --git a/tools/export_policy.toml b/tools/export_policy.toml index ca6caf67..ec98c7f0 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -2786,6 +2786,19 @@ names = [ "boost::type_traits::detail::sized_type_for_promotion", ] +# -------------------------------------------------------------------------- +# units + +[[units.guard]] +if = "!defined(BOOST_UNITS_NO_PASCAL)" +reason = ''' +boost/units/systems/si/pressure.hpp defines BOOST_UNITS_NO_PASCAL under +BOOST_MSVC and omits boost::units::si::pascal. +''' +names = [ + "boost::units::si::pascal", +] + # -------------------------------------------------------------------------- # url From d23d7315e46a7c8d8af17ed259e4692d04c7b38e Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Fri, 4 Dec 2026 09:20:50 +0000 Subject: [PATCH 07/21] docs(agents): record Windows native MSVC CI adaptations --- ...2-04-windows-msvc-ci-adaptations-design.md | 137 ++++++++++++++++++ .agents/docs/README.md | 11 +- 2 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 .agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md diff --git a/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md b/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md new file mode 100644 index 00000000..9fbbe109 --- /dev/null +++ b/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md @@ -0,0 +1,137 @@ +--- +subject: ci +status: active +--- + +# Windows 原生 MSVC(`msvc@system`)CI 适配记录 + +来源:PR #16(分支 `ci/windows-msvc-system`)在 `Build and Tests` 工作流中新增 +`windows-msvc-x86_64`(`msvc@system`,通过 `setup-msvc-dev` 固定 MSVC 14.52 + +Windows SDK 10.0.26100.0)。 + +## 背景 + +此前 Windows CI 仅覆盖 `windows-llvm-msvc`(`clang-cl` / `llvm@23.1.3`)。虽然 +`clang-cl` 与原生 `cl.exe` 共用 Windows SDK、MSVC STL 与 MSVC ABI,且都定义了 +`_MSC_VER`,但二者在 Boost 条件编译上有三处本质差异: + +1. `clang-cl` 定义 `__clang__`,不定义 `BOOST_MSVC`;原生 `cl.exe` 定义 + `BOOST_MSVC`,不定义 `__clang__` 与 `__GNUC__`。 +2. `Boost.Config` 对 `BOOST_MSVC` 无条件定义 `BOOST_NO_COMPLETE_VALUE_INITIALIZATION`, + 经由 `cxx_composite.hpp` 连带定义 `BOOST_NO_CXX03` 与 `BOOST_NO_CXX11`。 +3. `cl.exe` 在未传 `/Zc:__cplusplus` 时将 `__cplusplus` 固定为 `199711L`,即便开启 + `/std:c++latest`。 + +因此启用原生 `cl.exe` 后,集中暴露了一批仅在 `BOOST_MSVC` 下触发的头文件分支、 +导出符号差异与编译器行为差异。 + +## 已落地的适配 + +### 1. `hana`:保护不支持 MSVC 的 `experimental/type_name.hpp`(`25ec4c4d`) + +- **现象**:依赖扫描阶段即在 `src/hana.cppm` 失败: + `boost/hana/experimental/type_name.hpp(41): fatal error C1189: #error: "No support for this compiler."` +- **原因**:上游 `type_name.hpp` 仅实现了 `BOOST_HANA_CONFIG_CLANG` 与 + `BOOST_HANA_CONFIG_GCC` 两个分支。 +- **决策**: + - 在 `src/hana.cppm` 中用 + `#if defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC)` + 保护 `#include `(`gen_exports.py --check` + 按文本扫描 GMF `#include`,与 `src/process.cppm` 惯例一致)。 + - 在 `tools/export_policy.toml` 新增 `[[hana.guard]]`,按同一上游条件保护该头文件 + 声明的 4 个符号(`boost::hana::experimental::type_name`、 + `detail::cstring`、`detail::type_name_impl1`、`detail::type_name_impl2`), + 并重新生成 `generated/exports/hana.inc` 与 `generated/meta/skipped.txt`。 + +### 2. `type_traits` 与 `variant`:补齐 `BOOST_MSVC` 条件导出与 `::mpl_` 映射(`c4a5383e`) + +- **现象**:`src/type_traits.cppm` 出现 8 个 `C2039` / `C3083` / `C2873` 错误。 +- **原因与决策**:均为 `BOOST_MSVC` 下的上游分支差异,在 `tools/export_policy.toml` + 按上游宏条件添加 `guard` 并重新生成导出文件: + +| 模块 | 符号 | 上游条件 / 原因 | 处理 | +|---|---|---|---| +| `type_traits` | `boost::detail::false_or_cpp11_noexcept_move_assignable` | `is_nothrow_move_assignable.hpp` 在 MSVC 走 `BOOST_IS_NOTHROW_MOVE_ASSIGN` 内建分支 | `!defined(BOOST_IS_NOTHROW_MOVE_ASSIGN)` | +| `type_traits` | `boost::detail::false_or_cpp11_noexcept_move_constructible` | `is_nothrow_move_constructible.hpp` 走 `BOOST_IS_NOTHROW_MOVE_CONSTRUCT` 分支 | `!defined(BOOST_IS_NOTHROW_MOVE_CONSTRUCT)` | +| `type_traits` | `::mpl_::{bool_,integral_c,integral_c_tag}` | `integral_constant.hpp` 在 `BOOST_MSVC` 下跳过 `::mpl_` 隔离命名空间,直接声明在 `boost::mpl` | `!defined(BOOST_MSVC) && !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE)`,并在 `#else` 导出 `boost::mpl::*` | +| `type_traits` | `boost::tt_align_ns::{a2,a4}` | `type_with_alignment.hpp` 仅 GCC/Clang 分支声明 `a2`/`a4`,MSVC 分支从 `a8` 起 | `(defined(__GNUC__) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS)` | +| `type_traits` | `boost::type_traits::detail::sized_type_for_promotion` | `integral_promotion.hpp` 仅在 `!defined(BOOST_MSVC)` 下声明 | `!defined(BOOST_MSVC)` | +| `variant` | `::mpl_::{_,_1.._6,arg,false_,int_,long_,na,size_t,true_,void_}`(15 个) | `boost/mpl/aux_/config/adl.hpp` 在 `BOOST_MSVC` 下定义 `BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE` | 主动排查一并修复:`!defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE)`,并在 `#else` 导出 `boost::mpl::*` | + +### 3. `concept_check`:处理 `msvc.hpp` 分支与 include guard 冲突(`a3401a05`) + +- **现象**:`src/concept_check.cppm` 报 `boost::concept_check_`、`concept_check_failed`、 + `constraint_check`、`constraint_check_failed`、`boost::concept_checking::*`、 + `boost::concepts::{constraint,requirement,requirement_}`、`detail::instantiate` + 均未声明。 +- **原因**: + 1. `boost/concept/assert.hpp` 在 `BOOST_MSVC` 下包含 `boost/concept/detail/msvc.hpp` + 而非 `general.hpp`,改为声明 `boost::concepts::{check,require,require_}` 及 + `boost::concepts::detail::constraint`。 + 2. 上游 `boost/concept/detail/msvc.hpp` 与 `boost/concept_check/general.hpp` 共享 + 同一个 include guard `BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP`,导致后者在 + MSVC 下被完全跳过。 +- **决策**:在 `tools/export_policy.toml` 中以 `!defined(BOOST_MSVC)` 保护 general + 分支符号,并在 `#else` 分支导出 MSVC 下 `BOOST_CONCEPT_ASSERT` 实际使用的 + `boost::concepts::{check,require,require_}` 与 `boost::concepts::detail::constraint`。 + +### 4. `algorithm` 与 `math`:保护 `is_blank` 并消除 `differentiation::detail` 歧义(`280ae791`) + +- **`algorithm`**: + - **现象**:`boost::is_blank` 与 `boost::algorithm::is_blank` 在 MSVC 下未声明。 + - **原因**:`boost/algorithm/string/classification.hpp` 将二者置于 `#ifndef BOOST_NO_CXX11` + 内,而 `Boost.Config` 对 MSVC 定义了 `BOOST_NO_CXX11`。 + - **决策**:在 `tools/export_policy.toml` 添加 `!defined(BOOST_NO_CXX11)` 保护。 +- **`math`**: + - **现象**:`lanczos_smoothing.hpp`、`finite_difference.hpp`、`condition_numbers.hpp` + 及 `generated/exports/math.inc(1843-1849)` 报 `error C2872: 'detail': ambiguous symbol` + (`boost::math::differentiation::detail` 与 `boost::math::differentiation::autodiff_v1::detail` 冲突)。 + - **原因**:`autodiff.hpp` 定义了 `inline namespace autodiff_v1 { namespace detail { ... } }`, + 与 `lanczos_smoothing.hpp` / `finite_difference.hpp` 的 `boost::math::differentiation::detail` + 落在同一模块 GMF 中;MSVC 对限定/非限定查找 `detail` 严格报歧义。 + - **决策**: + - 在 `patches/math.patch` 中引入 `BOOST_MATH_DIFF_DETAIL_NS` 宏:非 MSVC 展开为 + `detail`(AST 与导出集合零变化),`BOOST_MSVC` 下展开为 `diff_detail`,应用于 + `lanczos_smoothing.hpp`、`finite_difference.hpp` 与 `condition_numbers.hpp`。 + - 在 `tools/export_policy.toml` 中以 `!defined(BOOST_MSVC)` 保护 + `boost::math::differentiation::detail` 下的 7 个内部 helper 导出,既满足 MSVC + 编译,又不丢失非 MSVC 的可达导出(`check_reachable.py` 通过)。 + - **否决方案**:直接改名 `autodiff_v1::detail`(涉及 68 个导出符号,且 `autodiff.hpp` + 内部多处引用 `differentiation::detail::fvar`)。 + +### 5. MSVC `/Zc:__cplusplus` 与 `units`(`060138bc`) + +- **`/Zc:__cplusplus`(修复 `hana/traits.hpp`)**: + - **现象**:`boost/hana/traits.hpp(74): error C2039: 'is_literal_type': is not a member of 'std'`。 + - **原因**:`hana/traits.hpp` 使用 `#if __cplusplus < 201703L` 保护 `std::is_literal_type`, + 而 MSVC 未传 `/Zc:__cplusplus` 时 `__cplusplus` 为 `199711L`,在 `/std:c++latest` + 下误入该分支并引用了 C++20 已移除的 trait。 + - **决策**:在 `mcpp.toml` 新增 `[target.'cfg(compiler = "msvc")'.build]`,设置 + `cxxflags = ["/Zc:__cplusplus"]`。 +- **`units`**: + - **现象**:`generated/exports/units.inc(823): error C2039: 'pascal': is not a member of 'boost::units::si'`。 + - **原因**:`boost/units/systems/si/pressure.hpp` 在 `BOOST_MSVC` 下定义 + `BOOST_UNITS_NO_PASCAL` 并省略 `pascal`。 + - **决策**:在 `tools/export_policy.toml` 为 `boost::units::si::pascal` 添加 + `!defined(BOOST_UNITS_NO_PASCAL)` 保护。 + +## 待跟进事项 + +1. **`type_erasure` MSVC ICE**:在 `280ae791` 的 `group A` 日志中, + `src/type_erasure.cppm(28)`(模块文件末尾,写 `.ifc` 阶段)触发 + `fatal error C1001: Internal compiler error (compiler file 'msc1.cpp', line 1678)`, + 附带 `note: IFC import detected`。需在 `060138bc` 的 CI 结果出来后确认是否仍复现; + 若仍复现,需定位触发 ICE 的具体导入或导出项并制定规避方案。 +2. **后续模块、测试与示例验证**:待 `group A` / `group B` 全部模块编译通过后, + 继续排查可能出现的链接/运行期问题,并验证 `examples` job;全部落地前补充更新 + `patches/README.md` 对 `math.patch` 新增改动的说明,并将本记录状态置为 `landed`。 + +## 本地验证 + +每轮修改均已在本地通过: + +- `uv run --project tools --locked python -m unittest discover -s tests`(114 tests OK) +- `uv run --project tools --locked python tools/gen_features.py --check` +- `uv run --project tools --locked python tools/apply_patches.py` +- `uv run --project tools --locked python tools/ci/check_reachable.py --base origin/main` +- `python3 tools/doc-tools/check_docs.py` diff --git a/.agents/docs/README.md b/.agents/docs/README.md index b8669b62..2f36bb5e 100644 --- a/.agents/docs/README.md +++ b/.agents/docs/README.md @@ -27,10 +27,11 @@ - `todos/` 放尚未完成的工作项,它们不是决定的记录。 - 移动或改名用 `tools/doc-tools/move_record.py`,它同时改写仓库中对该文件的引用。 -共 31 篇记录(其中 0 篇已归档),1 项待办。 +共 32 篇记录(其中 0 篇已归档),1 项待办。 ## 进行中 +- [Windows 原生 MSVC(`msvc@system`)CI 适配记录](2026-12-04-windows-msvc-ci-adaptations-design.md) — active - [PR #5 第二轮评审的 [nit] 修复:覆盖率按测试程序列出的用例核对](2026-11-21-pr5-review-nits-design.md) — active - [子工程复用根工程的构建产物,mcpp 升级到 2026.11.20.1](2026-11-20-sub-project-build-reuse-design.md) — active - [模块测试加固的发现复盘:封装层缺陷与上游 Boost 问题(对照 1.93.0.beta1)](2026-11-12-module-tests-findings-and-upstream-bugs-analysis.md) — active @@ -39,6 +40,10 @@ 只列出声明了 subject 的记录。 +### ci + +- [Windows 原生 MSVC(`msvc@system`)CI 适配记录](2026-12-04-windows-msvc-ci-adaptations-design.md) — active + ### docs - [设计记录的管理:只增不删、按年归档、生成的索引与 `tools/doc-tools/`](2026-11-08-design-records-management-design.md) — landed @@ -64,6 +69,10 @@ ## 按日期 +### 2026-12 + +- [Windows 原生 MSVC(`msvc@system`)CI 适配记录](2026-12-04-windows-msvc-ci-adaptations-design.md) — active + ### 2026-11 - [可达导出集合检查与 issue #2 剩余名称的处理](2026-11-29-reachable-exports-design.md) — landed From 0570f0d0ff9bd92220ad0e3ba9a21e1df25b9cec Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 06:20:43 +0000 Subject: [PATCH 08/21] fix(uuid,convert): guard __SIZEOF_INT128__ and MSVC-divergent parameter::aux exports --- generated/exports/convert.inc | 5 +++++ generated/exports/uuid.inc | 24 ++++++++++++++++++++++++ generated/meta/skipped.txt | 9 +++++++++ tools/export_policy.toml | 31 +++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+) diff --git a/generated/exports/convert.inc b/generated/exports/convert.inc index 6e0feabd..d210565a 100644 --- a/generated/exports/convert.inc +++ b/generated/exports/convert.inc @@ -155,9 +155,14 @@ export namespace boost { namespace parameter { namespace aux { using boost::parameter::aux::parameter_requirements; using boost::parameter::aux::result_of0; using boost::parameter::aux::tag; +#if defined(BOOST_PARAMETER_CAN_USE_MP11) && !BOOST_WORKAROUND(BOOST_MSVC, >= 1910) + // boost/parameter/aux_/tag.hpp declares tag_if_lvalue_reference, tag_if_otherwise + // and tag_if_scalar only in its MP11 branch, which upstream disables on + // MSVC >= 1910 (falling back to the perfect-forwarding MPL branch). using boost::parameter::aux::tag_if_lvalue_reference; using boost::parameter::aux::tag_if_otherwise; using boost::parameter::aux::tag_if_scalar; +#endif using boost::parameter::aux::tagged_argument; using boost::parameter::aux::tagged_argument_base; using boost::parameter::aux::tagged_argument_list_of_1; diff --git a/generated/exports/uuid.inc b/generated/exports/uuid.inc index 28887d1e..831581b2 100644 --- a/generated/exports/uuid.inc +++ b/generated/exports/uuid.inc @@ -76,15 +76,27 @@ export namespace boost { namespace uuids { namespace detail { using boost::uuids::detail::is_constant_evaluated_cx; using boost::uuids::detail::is_constant_evaluated_rt; using boost::uuids::detail::left_rotate; +#if defined(__SIZEOF_INT128__) + // boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under + // defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. using boost::uuids::detail::load_big_u128; +#endif using boost::uuids::detail::load_big_u16; using boost::uuids::detail::load_big_u32; using boost::uuids::detail::load_big_u64; +#if defined(__SIZEOF_INT128__) + // boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under + // defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. using boost::uuids::detail::load_little_u128; +#endif using boost::uuids::detail::load_little_u16; using boost::uuids::detail::load_little_u32; using boost::uuids::detail::load_little_u64; +#if defined(__SIZEOF_INT128__) + // boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under + // defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. using boost::uuids::detail::load_native_u128; +#endif using boost::uuids::detail::load_native_u16; using boost::uuids::detail::load_native_u32; using boost::uuids::detail::load_native_u64; @@ -107,15 +119,27 @@ export namespace boost { namespace uuids { namespace detail { using boost::uuids::detail::simd_vector256; using boost::uuids::detail::simd_vector512; #endif +#if defined(__SIZEOF_INT128__) + // boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under + // defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. using boost::uuids::detail::store_big_u128; +#endif using boost::uuids::detail::store_big_u16; using boost::uuids::detail::store_big_u32; using boost::uuids::detail::store_big_u64; +#if defined(__SIZEOF_INT128__) + // boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under + // defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. using boost::uuids::detail::store_little_u128; +#endif using boost::uuids::detail::store_little_u16; using boost::uuids::detail::store_little_u32; using boost::uuids::detail::store_little_u64; +#if defined(__SIZEOF_INT128__) + // boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under + // defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. using boost::uuids::detail::store_native_u128; +#endif using boost::uuids::detail::store_native_u16; using boost::uuids::detail::store_native_u32; using boost::uuids::detail::store_native_u64; diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index 72c4556d..7fbea733 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -137,6 +137,9 @@ container guard boost::container_winapi::BOOL_ if defined(_WIN32) -- M11 platfor container guard boost::container_winapi::DWORD_ if defined(_WIN32) -- M11 platform guard: container_winapi DWORD_/BOOL_/SleepEx are declared only in the _WIN32 branch of container/detail/mutex.hpp. contract unreachable boost::mpl::aux::template_arity -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. contract unreachable boost::mpl::lambda -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. +convert guard boost::parameter::aux::tag_if_lvalue_reference if defined(BOOST_PARAMETER_CAN_USE_MP11) && !BOOST_WORKAROUND(BOOST_MSVC, >= 1910) -- boost/parameter/aux_/tag.hpp declares tag_if_lvalue_reference, tag_if_otherwise and tag_if_scalar only in its MP11 branch, which upstream disables on MSVC >= 1910 (falling back to the perfect-forwarding MPL branch). +convert guard boost::parameter::aux::tag_if_otherwise if defined(BOOST_PARAMETER_CAN_USE_MP11) && !BOOST_WORKAROUND(BOOST_MSVC, >= 1910) -- boost/parameter/aux_/tag.hpp declares tag_if_lvalue_reference, tag_if_otherwise and tag_if_scalar only in its MP11 branch, which upstream disables on MSVC >= 1910 (falling back to the perfect-forwarding MPL branch). +convert guard boost::parameter::aux::tag_if_scalar if defined(BOOST_PARAMETER_CAN_USE_MP11) && !BOOST_WORKAROUND(BOOST_MSVC, >= 1910) -- boost/parameter/aux_/tag.hpp declares tag_if_lvalue_reference, tag_if_otherwise and tag_if_scalar only in its MP11 branch, which upstream disables on MSVC >= 1910 (falling back to the perfect-forwarding MPL branch). core drop boost::size -- boost/core/size.hpp is `namespace boost { using std::size; }` under C++17. Exported, it meets Boost.Range's boost::size (boost/range/size.hpp) in every consumer that imports both, and boost::size(range) is ambiguous (the geometry examples call it). The headers are rarely both included; the module graph always has both. std::size is the same function. core guard boost::core::detail::copysign_impl if defined(__GNUC__) -- M3 hand-guard: boost/core/cmath.hpp defines copysign_impl only on gcc-like compilers. core guard boost::core::detail::sp_thread_sleep if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -- M6 platform guard: sp_thread_sleep/yield live in boost::core::detail only on Windows; on POSIX (nanosleep/sched_yield branch of the header) they are declared in boost::core. @@ -861,10 +864,16 @@ uuid guard boost::uuids::detail::from_chars_simd_char_constants if defined(BOOST uuid guard boost::uuids::detail::from_chars_simd_constants if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. uuid guard boost::uuids::detail::from_chars_simd_core if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. uuid guard boost::uuids::detail::from_chars_simd_load_traits if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. +uuid guard boost::uuids::detail::load_big_u128 if defined(__SIZEOF_INT128__) -- boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. +uuid guard boost::uuids::detail::load_little_u128 if defined(__SIZEOF_INT128__) -- boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. +uuid guard boost::uuids::detail::load_native_u128 if defined(__SIZEOF_INT128__) -- boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. uuid guard boost::uuids::detail::simd_vector if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. uuid guard boost::uuids::detail::simd_vector128 if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. uuid guard boost::uuids::detail::simd_vector256 if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. uuid guard boost::uuids::detail::simd_vector512 if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. +uuid guard boost::uuids::detail::store_big_u128 if defined(__SIZEOF_INT128__) -- boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. +uuid guard boost::uuids::detail::store_little_u128 if defined(__SIZEOF_INT128__) -- boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. +uuid guard boost::uuids::detail::store_native_u128 if defined(__SIZEOF_INT128__) -- boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. uuid guard boost::uuids::detail::to_chars_simd if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. uuid guard boost::uuids::detail::to_chars_simd_char_constants if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. uuid guard boost::uuids::detail::to_chars_simd_constants if defined(BOOST_UUID_USE_SSE2) -- The SIMD to_chars/from_chars helpers are declared only under BOOST_UUID_USE_SSE2 (x86); arm64 takes the scalar path. diff --git a/tools/export_policy.toml b/tools/export_policy.toml index ec98c7f0..6523334f 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -950,6 +950,22 @@ names = [ "boost::container_winapi::DWORD_", ] +# -------------------------------------------------------------------------- +# convert + +[[convert.guard]] +if = "defined(BOOST_PARAMETER_CAN_USE_MP11) && !BOOST_WORKAROUND(BOOST_MSVC, >= 1910)" +reason = ''' +boost/parameter/aux_/tag.hpp declares tag_if_lvalue_reference, tag_if_otherwise +and tag_if_scalar only in its MP11 branch, which upstream disables on +MSVC >= 1910 (falling back to the perfect-forwarding MPL branch). +''' +names = [ + "boost::parameter::aux::tag_if_lvalue_reference", + "boost::parameter::aux::tag_if_otherwise", + "boost::parameter::aux::tag_if_scalar", +] + # -------------------------------------------------------------------------- # core @@ -2840,6 +2856,21 @@ names = [ # any :: segment "to_chars_simd_core", ] +[[uuid.guard]] +if = "defined(__SIZEOF_INT128__)" +reason = ''' +boost/uuid/detail/endian.hpp declares load_*_u128 and store_*_u128 only under +defined(__SIZEOF_INT128__); native MSVC does not provide __uint128_t. +''' +names = [ + "boost::uuids::detail::load_big_u128", + "boost::uuids::detail::load_little_u128", + "boost::uuids::detail::load_native_u128", + "boost::uuids::detail::store_big_u128", + "boost::uuids::detail::store_little_u128", + "boost::uuids::detail::store_native_u128", +] + # -------------------------------------------------------------------------- # variant From f49ea5d4f52233c542fb9fde0d9087292e9378c6 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 06:44:45 +0000 Subject: [PATCH 09/21] fix(type_erasure): disable SFINAE-friendly constructors on MSVC to avoid IFC ICE --- generated/exports/type_erasure.inc | 36 +++++++++++++++++++ generated/meta/skipped.txt | 13 +++++++ patches/README.md | 11 ++++++ patches/type_erasure.patch | 12 +++++++ tools/apply_patches.py | 2 +- tools/export_policy.toml | 24 +++++++++++++ .../boost/type_erasure/detail/access.hpp | 1 + 7 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 patches/type_erasure.patch diff --git a/generated/exports/type_erasure.inc b/generated/exports/type_erasure.inc index ce35104f..7bd53dea 100644 --- a/generated/exports/type_erasure.inc +++ b/generated/exports/type_erasure.inc @@ -20,8 +20,14 @@ export namespace boost { namespace type_erasure { using boost::type_erasure::any; using boost::type_erasure::any_base; using boost::type_erasure::any_cast; +#if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) + // Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in + // boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native + // MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP + // cycle any -> any_constructor_control -> compute_bases. using boost::type_erasure::any_constructor_control; using boost::type_erasure::any_constructor_impl; +#endif using boost::type_erasure::any_cref; using boost::type_erasure::any_ref; using boost::type_erasure::any_rvref; @@ -164,7 +170,13 @@ export namespace boost { namespace type_erasure { namespace detail { using boost::type_erasure::detail::dynamic_binding_element; using boost::type_erasure::detail::dynamic_binding_impl; using boost::type_erasure::detail::dynamic_vtable; +#if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) + // Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in + // boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native + // MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP + // cycle any -> any_constructor_control -> compute_bases. using boost::type_erasure::detail::empty; +#endif using boost::type_erasure::detail::eval_if; using boost::type_erasure::detail::eval_if_impl; using boost::type_erasure::detail::extract; @@ -194,10 +206,16 @@ export namespace boost { namespace type_erasure { namespace detail { using boost::type_erasure::detail::get_pointer; using boost::type_erasure::detail::get_signature; using boost::type_erasure::detail::get_vtable_signature; +#if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) + // Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in + // boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native + // MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP + // cycle any -> any_constructor_control -> compute_bases. using boost::type_erasure::detail::has_constructor; using boost::type_erasure::detail::has_copy_constructor; using boost::type_erasure::detail::has_move_constructor; using boost::type_erasure::detail::has_mutable_copy_constructor; +#endif using boost::type_erasure::detail::has_type; using boost::type_erasure::detail::identity; using boost::type_erasure::detail::ignore; @@ -207,15 +225,27 @@ export namespace boost { namespace type_erasure { namespace detail { using boost::type_erasure::detail::instantiate_concept_impl; using boost::type_erasure::detail::instantiate_concept_rebind_f; using boost::type_erasure::detail::is_any; +#if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) + // Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in + // boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native + // MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP + // cycle any -> any_constructor_control -> compute_bases. using boost::type_erasure::detail::is_any_arg; using boost::type_erasure::detail::is_binding_arg; +#endif using boost::type_erasure::detail::is_deduced; using boost::type_erasure::detail::is_internal_concept; using boost::type_erasure::detail::is_non_const_ref; using boost::type_erasure::detail::is_placeholder_arg; using boost::type_erasure::detail::is_relaxed_impl; using boost::type_erasure::detail::is_rvalue_for_any; +#if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) + // Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in + // boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native + // MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP + // cycle any -> any_constructor_control -> compute_bases. using boost::type_erasure::detail::is_static_binding_arg; +#endif using boost::type_erasure::detail::is_subconcept_f; using boost::type_erasure::detail::is_subconcept_impl; using boost::type_erasure::detail::iterator_value_type_impl; @@ -288,9 +318,15 @@ export namespace boost { namespace type_erasure { namespace detail { using boost::type_erasure::detail::resolve_same_type; using boost::type_erasure::detail::resolve_same_type_impl; using boost::type_erasure::detail::resolve_same_type_t; +#if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) + // Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in + // boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native + // MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP + // cycle any -> any_constructor_control -> compute_bases. using boost::type_erasure::detail::safe_concept_of; using boost::type_erasure::detail::safe_placeholder_of; using boost::type_erasure::detail::safe_placeholder_t; +#endif using boost::type_erasure::detail::select_pair; using boost::type_erasure::detail::should_be_const; using boost::type_erasure::detail::should_be_non_const; diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index 7fbea733..90c3e06d 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -835,6 +835,19 @@ thread guard boost::detail::win32::ticks_type if defined(_WIN32) -- The Win32 th thread guard boost::this_thread::interruptible_wait if defined(_WIN32) -- The Win32 thread backend (boost/thread/win32/*) of the MinGW snapshot; POSIX builds the pthread backend. thread guard boost::this_thread::no_interruption_point::non_interruptible_wait if defined(_WIN32) -- The Win32 thread backend (boost/thread/win32/*) of the MinGW snapshot; POSIX builds the pthread backend. tuple guard boost::tuples::detail::ignore_t if !defined(__GNUC__) -- M3 hand-guard: ignore_t is a member-pointer typedef; gcc treats it as internal linkage. +type_erasure guard boost::type_erasure::any_constructor_control if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::any_constructor_impl if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::empty if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::has_constructor if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::has_copy_constructor if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::has_move_constructor if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::has_mutable_copy_constructor if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::is_any_arg if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::is_binding_arg if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::is_static_binding_arg if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::safe_concept_of if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::safe_placeholder_of if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. +type_erasure guard boost::type_erasure::detail::safe_placeholder_t if defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS) -- Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle any -> any_constructor_control -> compute_bases. type_erasure unreachable boost::mpl::aux::template_arity -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. type_erasure unreachable boost::mpl::lambda -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. type_traits guard ::mpl_::bool_ if !defined(BOOST_MSVC) && !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) -- boost/type_traits/integral_constant.hpp declares bool_, integral_c and integral_c_tag directly in boost::mpl under BOOST_MSVC or BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE (no ::mpl_ barrier namespace). diff --git a/patches/README.md b/patches/README.md index a7cf81f0..6ac87354 100644 --- a/patches/README.md +++ b/patches/README.md @@ -119,3 +119,14 @@ from. A patch that neither applies nor is already applied fails the replay. defines it): namespace-scope `const int` objects are TU-local, so the config module could not export them, and the Boost.Math examples return them from `main`. + +`type_erasure.patch` disables `BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS` +under `BOOST_MSVC` in `boost/type_erasure/detail/access.hpp`. When enabled, +`boost::type_erasure::any` inherits from +`any_constructor_control>`, whose base +`compute_bases, Concept, T>::type` forms a mutual CRTP cycle +that triggers a native MSVC C++20 modules IFC serializer ICE (`fatal error +C1001`, `msc1.cpp:1678`). Disabling the macro on `BOOST_MSVC` selects +upstream's direct-CRTP fallback without affecting GCC or Clang (`clang-cl` +does not define `BOOST_MSVC`); the 13 helper symbols declared only under that +macro are guarded in `tools/export_policy.toml`. diff --git a/patches/type_erasure.patch b/patches/type_erasure.patch new file mode 100644 index 00000000..9007f5da --- /dev/null +++ b/patches/type_erasure.patch @@ -0,0 +1,12 @@ +diff --git a/upstream/boost/boost/type_erasure/detail/access.hpp b/upstream/boost/boost/type_erasure/detail/access.hpp +index 84c61931..02827d52 100644 +--- a/upstream/boost/boost/type_erasure/detail/access.hpp ++++ b/upstream/boost/boost/type_erasure/detail/access.hpp +@@ -18,6 +18,7 @@ + !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \ + !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && \ + !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && \ ++ !defined(BOOST_MSVC) && /* MSVC C++20 modules IFC serializer ICE (C1001, msc1.cpp:1678) on any -> any_constructor_control -> compute_bases */ \ + !BOOST_WORKAROUND(BOOST_MSVC, == 1800) && \ + !BOOST_WORKAROUND(BOOST_GCC, < 40800) && /* Inherited constructors */ \ + !(defined(__clang_major__) && __clang_major__ == 3 && __clang__minor__ <= 2) /* Inherited constructors */ diff --git a/tools/apply_patches.py b/tools/apply_patches.py index 2b2216e7..56d51a05 100644 --- a/tools/apply_patches.py +++ b/tools/apply_patches.py @@ -31,7 +31,7 @@ "accumulators", "algorithm", "asio", "beast", "bimap", "cobalt", "config_platform", "config_cstdlib", "config_user", "container", "convert", "hof", "interprocess", "io", "json", "lambda", "math", "mqtt5", "multi_array", "parameter", "range_adaptors", "numeric", "regex", - "safe_numerics", "serialization", "system", "test", "thread", "ublas", "units", + "safe_numerics", "serialization", "system", "test", "thread", "type_erasure", "ublas", "units", "url", "variant", ] diff --git a/tools/export_policy.toml b/tools/export_policy.toml index 6523334f..fce6893e 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -452,6 +452,30 @@ it when it is processed before poly_collection. """ names = ["boost::mpl::item_by_order_impl"] +[[type_erasure.guard]] +if = "defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS)" +reason = """ +Declared only under BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS in +boost/type_erasure/any.hpp, which patches/type_erasure.patch disables on native +MSVC to avoid an IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP +cycle any -> any_constructor_control -> compute_bases. +""" +names = [ + "boost::type_erasure::any_constructor_control", + "boost::type_erasure::any_constructor_impl", + "boost::type_erasure::detail::empty", + "boost::type_erasure::detail::has_constructor", + "boost::type_erasure::detail::has_copy_constructor", + "boost::type_erasure::detail::has_move_constructor", + "boost::type_erasure::detail::has_mutable_copy_constructor", + "boost::type_erasure::detail::is_any_arg", + "boost::type_erasure::detail::is_binding_arg", + "boost::type_erasure::detail::is_static_binding_arg", + "boost::type_erasure::detail::safe_concept_of", + "boost::type_erasure::detail::safe_placeholder_of", + "boost::type_erasure::detail::safe_placeholder_t", +] + [functional.deps] # boost::overloaded_function takes its targets as boost::function # (overloaded_function_detail::base's constructor parameter). The classes that diff --git a/upstream/boost/boost/type_erasure/detail/access.hpp b/upstream/boost/boost/type_erasure/detail/access.hpp index 84c61931..02827d52 100644 --- a/upstream/boost/boost/type_erasure/detail/access.hpp +++ b/upstream/boost/boost/type_erasure/detail/access.hpp @@ -18,6 +18,7 @@ !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \ !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && \ !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && \ + !defined(BOOST_MSVC) && /* MSVC C++20 modules IFC serializer ICE (C1001, msc1.cpp:1678) on any -> any_constructor_control -> compute_bases */ \ !BOOST_WORKAROUND(BOOST_MSVC, == 1800) && \ !BOOST_WORKAROUND(BOOST_GCC, < 40800) && /* Inherited constructors */ \ !(defined(__clang_major__) && __clang_major__ == 3 && __clang__minor__ <= 2) /* Inherited constructors */ From 25c147f71c6f69b817e1514e360f2bca361c807d Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 06:44:45 +0000 Subject: [PATCH 10/21] fix(build): omit boost.sort from root closure on MSVC when range is active --- build.mcpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/build.mcpp b/build.mcpp index 3761f7c3..3947f61d 100644 --- a/build.mcpp +++ b/build.mcpp @@ -130,14 +130,25 @@ int main() body += "export module mcpplibs.mwrap.boost:closure;\n"; // Known toolchain limits of the aggregate closure, reported rather than - // silently worked around. gcc 16.1 ICEs while writing the BMI of any - // aggregate that re-exports boost.sort (direct `import - // mcpplibs.mwrap.boost.sort;` consumers are unaffected), so the root - // closure leaves it out on gcc with an explicit warning. docs/usage.md - // records the limit; llvm and MSVC keep it in the closure. + // silently worked around: + // - gcc 16.1 ICEs while writing the BMI of any aggregate that re-exports + // boost.sort. + // - native MSVC rejects re-exporting both boost.range (which exports the + // function boost::sort) and boost.sort (which opens namespace boost::sort) + // in the same module with error C2757. + // Direct `import mcpplibs.mwrap.boost.sort;` consumers are unaffected in + // both cases. docs/usage.md records these limits. bool skip_sort = false; + const char* skip_sort_reason = nullptr; #if defined(__GNUC__) && !defined(__clang__) skip_sort = true; + skip_sort_reason = "under gcc (known BMI ICE when an aggregate re-exports it)"; +#elif defined(_MSC_VER) && !defined(__clang__) + if (mcpp::has_feature("range")) { + skip_sort = true; + skip_sort_reason = + "under MSVC when boost.range is also active (error C2757: boost::sort function vs namespace)"; + } #endif bool warned_sort = false; for (auto const& m : modules) { @@ -149,9 +160,10 @@ int main() body += "export import mcpplibs.mwrap.boost." + m.suffix + ";\n"; } if (warned_sort) { - mcpp::warning("build.mcpp: the root module leaves out mcpplibs.mwrap.boost.sort " - "under gcc (known BMI ICE when an aggregate re-exports it); " - "`import mcpplibs.mwrap.boost.sort;` directly instead."); + std::string msg = + std::string("build.mcpp: the root module leaves out mcpplibs.mwrap.boost.sort ") + + skip_sort_reason + "; `import mcpplibs.mwrap.boost.sort;` directly instead."; + mcpp::warning(msg.c_str()); } const fs::path out = fs::path(mcpp::out_dir()) / "boost_closure.cppm"; From b9329f74a4d0aa9e78a78dad9fe8181c5b6c2d72 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 06:44:45 +0000 Subject: [PATCH 11/21] docs(agents): record uuid, convert, type_erasure and sort closure MSVC fixes --- ...2-04-windows-msvc-ci-adaptations-design.md | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md b/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md index 9fbbe109..2970ba28 100644 --- a/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md +++ b/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md @@ -115,14 +115,43 @@ Windows SDK 10.0.26100.0)。 - **决策**:在 `tools/export_policy.toml` 为 `boost::units::si::pascal` 添加 `!defined(BOOST_UNITS_NO_PASCAL)` 保护。 +### 6. `uuid`、`convert`、`type_erasure` 与 `build.mcpp`(`boost.sort` 聚合冲突) + +- **`uuid`**: + - **现象**:`group B` 测试阶段构建 `src/uuid.cppm` 报 + `boost::uuids::detail::{load,store}_{big,little,native}_u128` 未声明。 + - **原因**:`boost/uuid/detail/endian.hpp` 将这 6 个 128 位辅助函数置于 + `#if defined(__SIZEOF_INT128__)` 内,原生 MSVC 不提供 `__uint128_t`。 + - **决策**:在 `tools/export_policy.toml` 为这 6 个符号添加 `defined(__SIZEOF_INT128__)` 保护。 +- **`convert`**: + - **现象**:`src/convert.cppm` 报 `boost::parameter::aux::{tag_if_lvalue_reference,tag_if_otherwise,tag_if_scalar}` 未声明。 + - **原因**:`boost/parameter/aux_/tag.hpp` 仅在 + `defined(BOOST_PARAMETER_CAN_USE_MP11) && !BOOST_WORKAROUND(BOOST_MSVC, >= 1910)` + 分支声明这 3 个辅助类型,MSVC 14.52 走 `BOOST_PARAMETER_HAS_PERFECT_FORWARDING` 分支。 + - **决策**:在 `tools/export_policy.toml` 按同一上游宏条件添加 `[[convert.guard]]`。 +- **`type_erasure`(MSVC IFC 序列化 ICE)**: + - **现象**:`src/type_erasure.cppm(28)` 触发 `fatal error C1001`(`msc1.cpp:1678`)。 + - **原因**:二分定位到最小复现仅需 `export namespace boost::type_erasure { using boost::type_erasure::any; }`。 + 当 `BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS` 开启时,`any` 继承自 + `any_constructor_control>`,而 `any_constructor_impl` + 又继承自 `compute_bases, Concept, T>::type`,形成相互 CRTP 环, + 触发原生 MSVC 14.52 写 `.ifc` 时的内部编译器错误。 + - **决策**:新增 `patches/type_erasure.patch`,在 `boost/type_erasure/detail/access.hpp` + 对 `BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS` 增加 `!defined(BOOST_MSVC)` + 条件(回退至上游自带的直接 CRTP 基类实现,不影响 GCC 与 Clang/`clang-cl`);在 + `tools/export_policy.toml` 以 `defined(BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS)` + 保护该分支下的 13 个辅助符号。 +- **`build.mcpp`(根模块 `:closure` 中的 `boost::sort` 函数/命名空间冲突)**: + - **现象**:`boost_closure.cppm` 同时重导出 `boost.range`(导出函数 `boost::sort`)与 + `boost.sort`(打开命名空间 `boost::sort`)时,原生 MSVC 报 + `error C2757: 'boost::sort': a symbol with this name already exists and therefore this name cannot be used as a namespace name`。 + - **决策**:在 `build.mcpp` 中于 `_MSC_VER && !__clang__` 且 `range` feature 启用时, + 参照 GCC 的既有做法从根模块 `:closure` 中略过 `mcpplibs.mwrap.boost.sort` 并输出警告; + 直接 `import mcpplibs.mwrap.boost.sort;` 不受影响。 + ## 待跟进事项 -1. **`type_erasure` MSVC ICE**:在 `280ae791` 的 `group A` 日志中, - `src/type_erasure.cppm(28)`(模块文件末尾,写 `.ifc` 阶段)触发 - `fatal error C1001: Internal compiler error (compiler file 'msc1.cpp', line 1678)`, - 附带 `note: IFC import detected`。需在 `060138bc` 的 CI 结果出来后确认是否仍复现; - 若仍复现,需定位触发 ICE 的具体导入或导出项并制定规避方案。 -2. **后续模块、测试与示例验证**:待 `group A` / `group B` 全部模块编译通过后, +1. **全量 CI 测试与示例验证**:等待 `group A` / `group B` 全部模块编译与测试运行通过, 继续排查可能出现的链接/运行期问题,并验证 `examples` job;全部落地前补充更新 `patches/README.md` 对 `math.patch` 新增改动的说明,并将本记录状态置为 `landed`。 From 0f09323e0383f3a6a270910b7ff74866aba79920 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 07:45:43 +0000 Subject: [PATCH 12/21] fix(msvc): use *.lib ldflags and pass /bigobj on native MSVC --- mcpp.toml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mcpp.toml b/mcpp.toml index 040d09b2..eec42184 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -308,8 +308,11 @@ cxxflags = ["-Wno-invalid-specialization"] # MSVC leaves __cplusplus at 199711L unless /Zc:__cplusplus is passed, causing # Boost headers that test __cplusplus (e.g. hana/traits.hpp) to take C++98 # branches and reference traits removed in C++20 (such as std::is_literal_type). +# Heavy template test TUs (geometry, math) exceed COFF's 65535-section limit +# without /bigobj. link.exe takes foo.lib rather than -lfoo (LNK4044). [target.'cfg(compiler = "msvc")'.build] -cxxflags = ["/Zc:__cplusplus"] +cxxflags = ["/Zc:__cplusplus", "/bigobj"] +ldflags = ["ws2_32.lib", "ntdll.lib", "shell32.lib", "advapi32.lib", "secur32.lib", "user32.lib", "synchronization.lib"] # -- generated by tools/gen_features.py - do not edit -- [features] @@ -516,7 +519,7 @@ all-modules = { implies = ["optional", "variant", "variant2", "any", "core", "co implies = ["any", "assert", "config", "core", "function", "iterator", "lexical-cast", "smart-ptr", "throw-exception", "type-index", "type-traits", "utility"] [features.property-tree] sources = ["src/property_tree.cppm"] - implies = ["any", "assert", "bind", "concept-check", "optional", "range", "serialization", "type-traits"] + implies = ["any", "assert", "bind", "concept-check", "multi-index", "optional", "range", "serialization", "type-traits"] [features.ptr-container] sources = ["src/ptr_container.cppm"] implies = ["array", "assert", "circular-buffer", "config", "core", "iterator", "range", "smart-ptr", "type-traits", "unordered"] @@ -683,9 +686,11 @@ sources = [ "!upstream/boost/libs/thread/src/pthread/**", "!upstream/boost/libs/log/src/posix/**", ] + # System libraries the Windows TUs need, mirroring upstream's WIN32 link set # (cobalt/process sockets and process info, log's object_name, atomic's -# WaitOnAddress). +# WaitOnAddress). Native MSVC passes *.lib in [target.'cfg(compiler = "msvc")'.build]. +[target.'cfg(os = "windows", not(compiler = "msvc"))'.build] ldflags = ["-lws2_32", "-lntdll", "-lshell32", "-ladvapi32", "-lsecur32", "-luser32", "-lsynchronization"] [target.unix.build] From e5203acf33d2eed9f43cc2a74e322736ced12bd7 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 07:45:43 +0000 Subject: [PATCH 13/21] fix(msvc): adapt internal-linkage helpers, url, openmethod, property_tree and statechart tests --- generated/exports/accumulators.inc | 18 ++++- generated/exports/bloom.inc | 7 +- generated/exports/interprocess.inc | 3 +- generated/exports/property_tree.deps | 2 +- generated/exports/serialization.inc | 3 +- generated/exports/sort.inc | 4 +- generated/exports/unordered.inc | 4 +- generated/meta/api-surface.json | 14 ++-- generated/meta/skipped.txt | 3 +- patches/accumulators.patch | 76 +++++++++++++++++++ patches/bloom.patch | 13 ++++ patches/interprocess.patch | 22 ++++++ patches/openmethod.patch | 13 ++++ patches/serialization.patch | 13 ++++ patches/sort.patch | 31 ++++++++ patches/unordered.patch | 26 +++++++ patches/url.patch | 62 +++++++++++++++ src/property_tree.cppm | 1 + tests/statechart.cpp | 2 +- tools/apply_patches.py | 8 +- tools/export_policy.toml | 11 ++- .../boost/accumulators/numeric/functional.hpp | 37 +++++---- .../accumulators/numeric/functional_fwd.hpp | 17 ++--- .../bloom/detail/fast_multiblock32_sse2.hpp | 2 +- .../interprocess/detail/os_file_functions.hpp | 4 +- upstream/boost/boost/openmethod/core.hpp | 2 +- .../boost/boost/serialization/singleton.hpp | 2 +- .../boost/sort/common/util/algorithm.hpp | 6 +- .../boost/boost/unordered/detail/foa/core.hpp | 2 +- .../boost/unordered/detail/implementation.hpp | 2 +- .../boost/boost/url/grammar/type_traits.hpp | 8 ++ upstream/boost/boost/url/static_url.hpp | 1 + upstream/boost/boost/url/url_base.hpp | 1 + upstream/boost/boost/url/url_view_base.hpp | 1 + 34 files changed, 357 insertions(+), 64 deletions(-) create mode 100644 patches/bloom.patch create mode 100644 patches/openmethod.patch create mode 100644 patches/sort.patch create mode 100644 patches/unordered.patch diff --git a/generated/exports/accumulators.inc b/generated/exports/accumulators.inc index ada6c3f9..ea3bed84 100644 --- a/generated/exports/accumulators.inc +++ b/generated/exports/accumulators.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=accumulators boost=1.92.0 target=x86_64-w64-mingw32 entities=711 +// lib=accumulators boost=1.92.0 target=x86_64-w64-mingw32 entities=727 export namespace boost { namespace accumulators { using boost::accumulators::absolute; @@ -596,7 +596,15 @@ export namespace boost { namespace mpl { namespace aux { }}} export namespace boost { namespace numeric { + using boost::numeric::as_max; + using boost::numeric::as_min; + using boost::numeric::as_one; + using boost::numeric::as_zero; + using boost::numeric::average; using boost::numeric::default_; + using boost::numeric::fdiv; + using boost::numeric::max_assign; + using boost::numeric::min_assign; using boost::numeric::one; using boost::numeric::one_or_default; using boost::numeric::pow; @@ -606,14 +614,22 @@ export namespace boost { namespace numeric { }} export namespace boost { namespace numeric { namespace detail { + using boost::numeric::detail::ignore_as_max; + using boost::numeric::detail::ignore_as_min; + using boost::numeric::detail::ignore_as_one; + using boost::numeric::detail::ignore_as_zero; using boost::numeric::detail::ignore_assign; + using boost::numeric::detail::ignore_average; using boost::numeric::detail::ignore_divides; using boost::numeric::detail::ignore_divides_assign; using boost::numeric::detail::ignore_equal_to; + using boost::numeric::detail::ignore_fdiv; using boost::numeric::detail::ignore_greater; using boost::numeric::detail::ignore_greater_equal; using boost::numeric::detail::ignore_less; using boost::numeric::detail::ignore_less_equal; + using boost::numeric::detail::ignore_max_assign; + using boost::numeric::detail::ignore_min_assign; using boost::numeric::detail::ignore_minus; using boost::numeric::detail::ignore_minus_assign; using boost::numeric::detail::ignore_modulus; diff --git a/generated/exports/bloom.inc b/generated/exports/bloom.inc index 891d82ce..ee8dc3f0 100644 --- a/generated/exports/bloom.inc +++ b/generated/exports/bloom.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=bloom boost=1.92.0 target=x86_64-w64-mingw32 entities=45 +// lib=bloom boost=1.92.0 target=x86_64-w64-mingw32 entities=46 export namespace boost { namespace bloom { using boost::bloom::block; @@ -37,9 +37,10 @@ export namespace boost { namespace bloom { namespace detail { using boost::bloom::detail::is_unsigned_integral_or_extended_unsigned_integral; using boost::bloom::detail::is_unsigned_or_extended_unsigned; #if defined(BOOST_BLOOM_SSE2) - // M9 platform guard: m128ix2 is the SSE2 branch of fast_multiblock32 - // (detail/sse2.hpp, __SSE2__); absent on arm64 (NEON branch). + // M9 platform guard: m128ix2 and mm_testc_si128 are the SSE2 branch of + // fast_multiblock32 (detail/sse2.hpp, __SSE2__); absent on arm64 (NEON branch). using boost::bloom::detail::m128ix2; + using boost::bloom::detail::mm_testc_si128; #endif using boost::bloom::detail::move_assign_if; using boost::bloom::detail::multiblock_fpr_base; diff --git a/generated/exports/interprocess.inc b/generated/exports/interprocess.inc index 76126323..7f86ac33 100644 --- a/generated/exports/interprocess.inc +++ b/generated/exports/interprocess.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=interprocess boost=1.92.0 target=x86_64-w64-mingw32 entities=726 +// lib=interprocess boost=1.92.0 target=x86_64-w64-mingw32 entities=727 export namespace boost { using boost::has_trivial_destructor; @@ -44,6 +44,7 @@ export namespace boost { namespace interprocess { using boost::interprocess::create_only; using boost::interprocess::create_only_t; using boost::interprocess::cv_status; + using boost::interprocess::default_map_options; using boost::interprocess::defer_lock; using boost::interprocess::defer_lock_type; using boost::interprocess::deleter; diff --git a/generated/exports/property_tree.deps b/generated/exports/property_tree.deps index b39e7164..23dd2176 100644 --- a/generated/exports/property_tree.deps +++ b/generated/exports/property_tree.deps @@ -1,7 +1,7 @@ mcpplibs.mwrap.boost.any mcpplibs.mwrap.boost.assert -mcpplibs.mwrap.boost.bind mcpplibs.mwrap.boost.concept_check +mcpplibs.mwrap.boost.multi_index mcpplibs.mwrap.boost.optional mcpplibs.mwrap.boost.range mcpplibs.mwrap.boost.serialization diff --git a/generated/exports/serialization.inc b/generated/exports/serialization.inc index acf33da7..a429ed3d 100644 --- a/generated/exports/serialization.inc +++ b/generated/exports/serialization.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=serialization boost=1.92.0 target=x86_64-w64-mingw32 entities=401 +// lib=serialization boost=1.92.0 target=x86_64-w64-mingw32 entities=402 export namespace boost { namespace archive { using boost::archive::BOOST_ARCHIVE_SIGNATURE; @@ -203,6 +203,7 @@ export namespace boost { namespace serialization { using boost::serialization::factory; using boost::serialization::free_loader; using boost::serialization::free_saver; + using boost::serialization::get_singleton_module; using boost::serialization::guid; using boost::serialization::guid_defined; using boost::serialization::implementation_level; diff --git a/generated/exports/sort.inc b/generated/exports/sort.inc index 589d5bb5..d94443b1 100644 --- a/generated/exports/sort.inc +++ b/generated/exports/sort.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=sort boost=1.92.0 target=x86_64-w64-mingw32 entities=160 +// lib=sort boost=1.92.0 target=x86_64-w64-mingw32 entities=162 export namespace boost { namespace sort { using boost::sort::block_indirect_sort; @@ -119,6 +119,8 @@ export namespace boost { namespace sort { namespace common { namespace util { using boost::sort::common::util::move_backward; using boost::sort::common::util::move_construct; using boost::sort::common::util::move_forward; + using boost::sort::common::util::nbits32; + using boost::sort::common::util::nbits64; using boost::sort::common::util::reverse; using boost::sort::common::util::upper_bound; using boost::sort::common::util::value_iter; diff --git a/generated/exports/unordered.inc b/generated/exports/unordered.inc index c519e362..1aa12243 100644 --- a/generated/exports/unordered.inc +++ b/generated/exports/unordered.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=unordered boost=1.92.0 target=x86_64-w64-mingw32 entities=245 +// lib=unordered boost=1.92.0 target=x86_64-w64-mingw32 entities=247 export namespace boost { using boost::concurrent_flat_map; @@ -69,6 +69,7 @@ export namespace boost { namespace unordered { namespace detail { using boost::unordered::detail::convert_from_anything; using boost::unordered::detail::convertible_to_from_range_t; using boost::unordered::detail::converting_key; + using boost::unordered::detail::default_bucket_count; using boost::unordered::detail::disable_if_forward; using boost::unordered::detail::double_to_size; using boost::unordered::detail::empty_emplace; @@ -175,6 +176,7 @@ export namespace boost { namespace unordered { namespace detail { namespace foa using boost::unordered::detail::foa::concurrent_table_core_impl; using boost::unordered::detail::foa::const_iterator_cast_tag; using boost::unordered::detail::foa::copy_assign_if; + using boost::unordered::detail::foa::default_bucket_count; using boost::unordered::detail::foa::dummy_group_accesses; using boost::unordered::detail::foa::dummy_groups; using boost::unordered::detail::foa::element_type; diff --git a/generated/meta/api-surface.json b/generated/meta/api-surface.json index 05458e2a..f5465018 100644 --- a/generated/meta/api-surface.json +++ b/generated/meta/api-surface.json @@ -25,7 +25,7 @@ "type_traits", "utility" ], - "exported": 711, + "exported": 727, "gmf": [ "boost/accumulators/statistics.hpp", "boost/accumulators/statistics/p_square_cumulative_distribution.hpp", @@ -275,7 +275,7 @@ "container_hash", "core" ], - "exported": 45, + "exported": 46, "gmf": [ "boost/bloom.hpp" ] @@ -1212,7 +1212,7 @@ "move", "winapi" ], - "exported": 726, + "exported": 727, "gmf": [ "boost/interprocess/allocators/adaptive_pool.hpp", "boost/interprocess/allocators/cached_adaptive_pool.hpp", @@ -1964,8 +1964,8 @@ "deps": [ "any", "assert", - "bind", "concept_check", + "multi_index", "optional", "range", "serialization", @@ -2175,7 +2175,7 @@ "type_traits", "utility" ], - "exported": 401, + "exported": 402, "gmf": [ "boost/archive/basic_xml_archive.hpp", "boost/archive/binary_wiarchive.hpp", @@ -2294,7 +2294,7 @@ "range", "type_traits" ], - "exported": 160, + "exported": 162, "gmf": [ "boost/sort/block_indirect_sort/blk_detail/constants.hpp", "boost/sort/common/deque_cnc.hpp", @@ -2663,7 +2663,7 @@ "mp11", "throw_exception" ], - "exported": 245, + "exported": 247, "gmf": [ "boost/unordered/concurrent_flat_map.hpp", "boost/unordered/concurrent_flat_set.hpp", diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index 90c3e06d..731d6e50 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -103,7 +103,8 @@ beast guard boost::beast::unit_test::detail::dstream_buf if defined(_WIN32) -- B bimap unreachable boost::mpl::aux::template_arity -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. bimap unreachable boost::mpl::lambda -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. bimap unreachable boost::mpl::vector -- Boost.MPL is include-only (docs/usage.md §2.3): no module owns its names, and the first module whose signatures mention one exports it. The generator before #1 counted each specialization a signature names as an entity of its own, so this module listed the primary template again. Nothing in this library's documentation, examples or tests in the 1.92.0 release spells it; a program that does includes the header. -bloom guard boost::bloom::detail::m128ix2 if defined(BOOST_BLOOM_SSE2) -- M9 platform guard: m128ix2 is the SSE2 branch of fast_multiblock32 (detail/sse2.hpp, __SSE2__); absent on arm64 (NEON branch). +bloom guard boost::bloom::detail::m128ix2 if defined(BOOST_BLOOM_SSE2) -- M9 platform guard: m128ix2 and mm_testc_si128 are the SSE2 branch of fast_multiblock32 (detail/sse2.hpp, __SSE2__); absent on arm64 (NEON branch). +bloom guard boost::bloom::detail::mm_testc_si128 if defined(BOOST_BLOOM_SSE2) -- M9 platform guard: m128ix2 and mm_testc_si128 are the SSE2 branch of fast_multiblock32 (detail/sse2.hpp, __SSE2__); absent on arm64 (NEON branch). charconv guard boost::charconv::detail::ieee754_binary80 if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 -- M11 platform guard: bit_layouts.hpp defines ieee754_binary80 only for 80-bit long double (x86-64 gcc/mingw); MSVC long double is 53-bit. charconv guard boost::charconv::detail::to_chars128 if defined(BOOST_CHARCONV_HAS_INT128) -- M11 platform guard: to_chars128 exists only under BOOST_CHARCONV_HAS_INT128 (to_chars_integer_impl.hpp). cobalt extra boost::cobalt::this_coro -- boost/cobalt/this_coro.hpp brings asio's awaitable tags into cobalt::this_coro with `using namespace asio::this_coro;` (the examples and the documentation write cobalt::this_coro::executor). A using-directive is not an entity the generator collects, so the names it makes visible are re-declared in the module. diff --git a/patches/accumulators.patch b/patches/accumulators.patch index 28d4dafd..b3facba0 100644 --- a/patches/accumulators.patch +++ b/patches/accumulators.patch @@ -610,3 +610,79 @@ index 61904f30..41e1c942 100644 BOOST_ACCUMULATORS_IGNORE_GLOBAL(tail_mean) } +diff --git a/upstream/boost/boost/accumulators/numeric/functional.hpp b/upstream/boost/boost/accumulators/numeric/functional.hpp +index 858decc1..346a6e55 100644 +--- a/upstream/boost/boost/accumulators/numeric/functional.hpp ++++ b/upstream/boost/boost/accumulators/numeric/functional.hpp +@@ -437,26 +437,23 @@ namespace boost { namespace numeric + {}; + } + +- namespace +- { +- op::min_assign const &min_assign = boost::detail::pod_singleton::instance; +- op::max_assign const &max_assign = boost::detail::pod_singleton::instance; +- op::fdiv const &fdiv = boost::detail::pod_singleton::instance; +- op::fdiv const &average = boost::detail::pod_singleton::instance; ///< INTERNAL ONLY +- op::as_min const &as_min = boost::detail::pod_singleton::instance; +- op::as_max const &as_max = boost::detail::pod_singleton::instance; +- op::as_zero const &as_zero = boost::detail::pod_singleton::instance; +- op::as_one const &as_one = boost::detail::pod_singleton::instance; +- +- BOOST_ACCUMULATORS_IGNORE_GLOBAL(min_assign) +- BOOST_ACCUMULATORS_IGNORE_GLOBAL(max_assign) +- BOOST_ACCUMULATORS_IGNORE_GLOBAL(fdiv) +- BOOST_ACCUMULATORS_IGNORE_GLOBAL(average) +- BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_min) +- BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_max) +- BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) +- BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) +- } ++ inline op::min_assign const &min_assign = boost::detail::pod_singleton::instance; ++ inline op::max_assign const &max_assign = boost::detail::pod_singleton::instance; ++ inline op::fdiv const &fdiv = boost::detail::pod_singleton::instance; ++ inline op::fdiv const &average = boost::detail::pod_singleton::instance; ///< INTERNAL ONLY ++ inline op::as_min const &as_min = boost::detail::pod_singleton::instance; ++ inline op::as_max const &as_max = boost::detail::pod_singleton::instance; ++ inline op::as_zero const &as_zero = boost::detail::pod_singleton::instance; ++ inline op::as_one const &as_one = boost::detail::pod_singleton::instance; ++ ++ BOOST_ACCUMULATORS_IGNORE_GLOBAL(min_assign) ++ BOOST_ACCUMULATORS_IGNORE_GLOBAL(max_assign) ++ BOOST_ACCUMULATORS_IGNORE_GLOBAL(fdiv) ++ BOOST_ACCUMULATORS_IGNORE_GLOBAL(average) ++ BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_min) ++ BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_max) ++ BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) ++ BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) + + /////////////////////////////////////////////////////////////////////////////// + // promote +diff --git a/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp b/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp +index 501f654b..fdb01a7b 100644 +--- a/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp ++++ b/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp +@@ -182,16 +182,13 @@ namespace boost { namespace numeric + struct as_one; + } + +- namespace +- { +- extern op::min_assign const &min_assign; +- extern op::max_assign const &max_assign; +- extern op::fdiv const &fdiv; +- extern op::as_min const &as_min; +- extern op::as_max const &as_max; +- extern op::as_zero const &as_zero; +- extern op::as_one const &as_one; +- } ++ extern op::min_assign const &min_assign; ++ extern op::max_assign const &max_assign; ++ extern op::fdiv const &fdiv; ++ extern op::as_min const &as_min; ++ extern op::as_max const &as_max; ++ extern op::as_zero const &as_zero; ++ extern op::as_one const &as_one; + + template + typename lazy_disable_if, mpl::if_, To &, To> >::type diff --git a/patches/bloom.patch b/patches/bloom.patch new file mode 100644 index 00000000..2b7da18e --- /dev/null +++ b/patches/bloom.patch @@ -0,0 +1,13 @@ +diff --git a/upstream/boost/boost/bloom/detail/fast_multiblock32_sse2.hpp b/upstream/boost/boost/bloom/detail/fast_multiblock32_sse2.hpp +index f90d9e21..771853c2 100644 +--- a/upstream/boost/boost/bloom/detail/fast_multiblock32_sse2.hpp ++++ b/upstream/boost/boost/bloom/detail/fast_multiblock32_sse2.hpp +@@ -37,7 +37,7 @@ struct m128ix2 + }; + + /* NOLINTNEXTLINE(readability-redundant-inline-specifier) */ +-static inline int mm_testc_si128(__m128i x,__m128i y) ++inline int mm_testc_si128(__m128i x,__m128i y) + { + #ifdef __SSE4_1__ + return _mm_testc_si128(x,y); diff --git a/patches/interprocess.patch b/patches/interprocess.patch index c886da89..1e7d07a8 100644 --- a/patches/interprocess.patch +++ b/patches/interprocess.patch @@ -88,3 +88,25 @@ index a79159a4..cb6a3423 100644 } // namespace interprocess { } // namespace boost{ +diff --git a/upstream/boost/boost/interprocess/detail/os_file_functions.hpp b/upstream/boost/boost/interprocess/detail/os_file_functions.hpp +index 137409da..92dfc70d 100644 +--- a/upstream/boost/boost/interprocess/detail/os_file_functions.hpp ++++ b/upstream/boost/boost/interprocess/detail/os_file_functions.hpp +@@ -76,7 +76,7 @@ typedef enum { file_begin = winapi::file_begin + } file_pos_t; + + typedef unsigned long map_options_t; +-static const map_options_t default_map_options = map_options_t(-1); ++BOOST_INLINE_CONSTEXPR map_options_t default_map_options = map_options_t(-1); + + namespace ipcdetail{ + +@@ -491,7 +491,7 @@ typedef enum { file_begin = SEEK_SET + } file_pos_t; + + typedef int map_options_t; +-static const map_options_t default_map_options = map_options_t(-1); ++BOOST_INLINE_CONSTEXPR map_options_t default_map_options = map_options_t(-1); + + namespace ipcdetail{ + diff --git a/patches/openmethod.patch b/patches/openmethod.patch new file mode 100644 index 00000000..c5ab4523 --- /dev/null +++ b/patches/openmethod.patch @@ -0,0 +1,13 @@ +diff --git a/upstream/boost/boost/openmethod/core.hpp b/upstream/boost/boost/openmethod/core.hpp +index 7c2d3837..acdec46e 100644 +--- a/upstream/boost/boost/openmethod/core.hpp ++++ b/upstream/boost/boost/openmethod/core.hpp +@@ -2263,7 +2263,7 @@ class method + //! @tparam Fn One or more functions to the overrider list + template + class override { +- std::tuple...> impl; ++ std::tuple>...> impl; + }; + + private: diff --git a/patches/serialization.patch b/patches/serialization.patch index 351b9265..c01adfbe 100644 --- a/patches/serialization.patch +++ b/patches/serialization.patch @@ -164,3 +164,16 @@ index 2011e77b..382eb354 100644 {} } // namespace archive +diff --git a/upstream/boost/boost/serialization/singleton.hpp b/upstream/boost/boost/serialization/singleton.hpp +index e2c78a15..6f2328ed 100644 +--- a/upstream/boost/boost/serialization/singleton.hpp ++++ b/upstream/boost/boost/serialization/singleton.hpp +@@ -118,7 +118,7 @@ public: + } + }; + +-static inline singleton_module & get_singleton_module(){ ++inline singleton_module & get_singleton_module(){ + static singleton_module m; + return m; + } diff --git a/patches/sort.patch b/patches/sort.patch new file mode 100644 index 00000000..17384994 --- /dev/null +++ b/patches/sort.patch @@ -0,0 +1,31 @@ +diff --git a/upstream/boost/boost/sort/common/util/algorithm.hpp b/upstream/boost/boost/sort/common/util/algorithm.hpp +index 3711cce5..94fcc18a 100644 +--- a/upstream/boost/boost/sort/common/util/algorithm.hpp ++++ b/upstream/boost/boost/sort/common/util/algorithm.hpp +@@ -47,7 +47,7 @@ namespace util + // + //---------------------------------------------------------------------------- + // +-// static inline uint32_t nbits32 (uint32_t num) noexcept ++// inline uint32_t nbits32 (uint32_t num) noexcept + // + // static inline uint32_t nbits64 (uint64_t num) + // +@@ -111,7 +111,7 @@ static constexpr const uint32_t tmsb[256] = + /// @param num : Number to examine + /// @return Number of bits + //--------------------------------------------------------------------------- +-static inline uint32_t nbits32 (uint32_t num) noexcept ++inline uint32_t nbits32 (uint32_t num) noexcept + { + int Pos = (num & 0xffff0000U) ? 16 : 0; + if ((num >> Pos) & 0xff00U) Pos += 8; +@@ -125,7 +125,7 @@ static inline uint32_t nbits32 (uint32_t num) noexcept + /// @exception none + /// @return Number of bits + //--------------------------------------------------------------------------- +-static inline uint32_t nbits64(uint64_t num)noexcept ++inline uint32_t nbits64(uint64_t num)noexcept + { + uint32_t Pos = (num & 0xffffffff00000000ULL) ? 32 : 0; + if ((num >> Pos) & 0xffff0000ULL) Pos += 16; diff --git a/patches/unordered.patch b/patches/unordered.patch new file mode 100644 index 00000000..35cfb40a --- /dev/null +++ b/patches/unordered.patch @@ -0,0 +1,26 @@ +diff --git a/upstream/boost/boost/unordered/detail/foa/core.hpp b/upstream/boost/boost/unordered/detail/foa/core.hpp +index a1ccdc17..b196869a 100644 +--- a/upstream/boost/boost/unordered/detail/foa/core.hpp ++++ b/upstream/boost/boost/unordered/detail/foa/core.hpp +@@ -148,7 +148,7 @@ namespace unordered{ + namespace detail{ + namespace foa{ + +-static constexpr std::size_t default_bucket_count=0; ++inline constexpr std::size_t default_bucket_count=0; + + /* foa::table_core is the common base of foa::table and foa::concurrent_table, + * which in their turn serve as the foundational core of +diff --git a/upstream/boost/boost/unordered/detail/implementation.hpp b/upstream/boost/boost/unordered/detail/implementation.hpp +index 16e36493..295a2677 100644 +--- a/upstream/boost/boost/unordered/detail/implementation.hpp ++++ b/upstream/boost/boost/unordered/detail/implementation.hpp +@@ -93,7 +93,7 @@ namespace boost { + template struct table; + + static const float minimum_max_load_factor = 1e-3f; +- static const std::size_t default_bucket_count = 0; ++ BOOST_INLINE_CONSTEXPR std::size_t default_bucket_count = 0; + + struct move_tag + { diff --git a/patches/url.patch b/patches/url.patch index 3c18fe4b..e54d826e 100644 --- a/patches/url.patch +++ b/patches/url.patch @@ -264,3 +264,65 @@ diff --git a/upstream/boost/boost/url/rfc/uri_rule.hpp b/upstream/boost/boost/ur } // urls } // boost +diff --git a/upstream/boost/boost/url/grammar/type_traits.hpp b/upstream/boost/boost/url/grammar/type_traits.hpp +index ff2e7b5c..e91b7c01 100644 +--- a/upstream/boost/boost/url/grammar/type_traits.hpp ++++ b/upstream/boost/boost/url/grammar/type_traits.hpp +@@ -116,6 +116,13 @@ using is_rule = implementation_defined::is_rule; + @ref parse, + @ref is_rule. + */ ++#if defined(BOOST_MSVC) ++// MSVC's C++20 module IFC serializer drops `const` from `char const*&` in a ++// concept requires-parameter list, making Rule evaluate to false for every ++// rule imported from mcpplibs.mwrap.boost.url. Delegate to is_rule. ++template ++concept Rule = is_rule::value; ++#else + template + concept Rule = + requires (T t, char const*& it, char const* end) +@@ -124,6 +131,7 @@ concept Rule = + { t.parse(it, end) } -> std::same_as>; + }; + #endif ++#endif + + + } // grammar +diff --git a/upstream/boost/boost/url/static_url.hpp b/upstream/boost/boost/url/static_url.hpp +index e5282d9f..b966bf44 100644 +--- a/upstream/boost/boost/url/static_url.hpp ++++ b/upstream/boost/boost/url/static_url.hpp +@@ -55,6 +55,7 @@ class BOOST_SYMBOL_VISIBLE static_url_base + template + friend class static_url; + ++protected: + ~static_url_base() = default; + static_url_base( + char* buf, std::size_t cap) noexcept; +diff --git a/upstream/boost/boost/url/url_base.hpp b/upstream/boost/boost/url/url_base.hpp +index 27973a0b..eaccf866 100644 +--- a/upstream/boost/boost/url/url_base.hpp ++++ b/upstream/boost/boost/url/url_base.hpp +@@ -87,6 +87,7 @@ class BOOST_SYMBOL_VISIBLE url_base + char* old = nullptr; + }; + ++protected: + virtual ~url_base() noexcept = default; + url_base() noexcept = default; + url_base(detail::url_impl const&) noexcept; +diff --git a/upstream/boost/boost/url/url_view_base.hpp b/upstream/boost/boost/url/url_view_base.hpp +index 7d59598c..1b81eb42 100644 +--- a/upstream/boost/boost/url/url_view_base.hpp ++++ b/upstream/boost/boost/url/url_view_base.hpp +@@ -112,6 +112,7 @@ class BOOST_SYMBOL_VISIBLE url_view_base + { + } + ++protected: + ~url_view_base() = default; + + BOOST_URL_CXX14_CONSTEXPR diff --git a/src/property_tree.cppm b/src/property_tree.cppm index 0136c0fa..463ef300 100644 --- a/src/property_tree.cppm +++ b/src/property_tree.cppm @@ -13,6 +13,7 @@ export import mcpplibs.mwrap.boost.any; export import mcpplibs.mwrap.boost.assert; export import mcpplibs.mwrap.boost.bind; export import mcpplibs.mwrap.boost.concept_check; +export import mcpplibs.mwrap.boost.multi_index; export import mcpplibs.mwrap.boost.optional; export import mcpplibs.mwrap.boost.range; export import mcpplibs.mwrap.boost.serialization; diff --git a/tests/statechart.cpp b/tests/statechart.cpp index f31d3acf..39955fff 100644 --- a/tests/statechart.cpp +++ b/tests/statechart.cpp @@ -4,10 +4,10 @@ // gcc, keeping the test pure-header) #include "test_assert.hpp" #include +#include #if !defined(__GNUC__) || defined(__clang__) import mcpplibs.mwrap.boost.statechart; #endif -#include #if defined(__GNUC__) && !defined(__clang__) // gcc: import skipped above — bring the statechart API in via header instead. // (deps/boost has no master boost/statechart.hpp — vendored subset — so diff --git a/tools/apply_patches.py b/tools/apply_patches.py index 56d51a05..d7f4feeb 100644 --- a/tools/apply_patches.py +++ b/tools/apply_patches.py @@ -28,11 +28,11 @@ # One entry per patches/.patch; see patches/README.md for each reason. PATCHES = [ - "accumulators", "algorithm", "asio", "beast", "bimap", "cobalt", "config_platform", + "accumulators", "algorithm", "asio", "beast", "bimap", "bloom", "cobalt", "config_platform", "config_cstdlib", "config_user", "container", "convert", "hof", "interprocess", "io", "json", "lambda", "math", - "mqtt5", "multi_array", "parameter", "range_adaptors", "numeric", "regex", - "safe_numerics", "serialization", "system", "test", "thread", "type_erasure", "ublas", "units", - "url", "variant", + "mqtt5", "multi_array", "openmethod", "parameter", "range_adaptors", "numeric", "regex", + "safe_numerics", "serialization", "sort", "system", "test", "thread", "type_erasure", "ublas", "units", + "unordered", "url", "variant", ] # A vendored file that is an addition, not a patch of an upstream file. diff --git a/tools/export_policy.toml b/tools/export_policy.toml index fce6893e..30cdabe5 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -490,6 +490,12 @@ add = ["function"] # which the include edges do not read. Upstream's CMake links Boost::utility. add = ["utility"] +[property_tree.deps] +# boost::property_tree::basic_ptree stores children in a Boost.MultiIndex +# container whose bidir_node_iterator relies on ADL finding +# boost::multi_index::detail::operator== (exported by boost.multi_index). +add = ["multi_index"] + [version.deps] # Hand-written module (src/version.cppm): the thin entry re-exports the macro # mapping module, where the constants live (one export owner). @@ -721,11 +727,12 @@ lines = [ [[bloom.guard]] if = "defined(BOOST_BLOOM_SSE2)" reason = ''' -M9 platform guard: m128ix2 is the SSE2 branch of fast_multiblock32 -(detail/sse2.hpp, __SSE2__); absent on arm64 (NEON branch). +M9 platform guard: m128ix2 and mm_testc_si128 are the SSE2 branch of +fast_multiblock32 (detail/sse2.hpp, __SSE2__); absent on arm64 (NEON branch). ''' names = [ "boost::bloom::detail::m128ix2", + "boost::bloom::detail::mm_testc_si128", ] # -------------------------------------------------------------------------- diff --git a/upstream/boost/boost/accumulators/numeric/functional.hpp b/upstream/boost/boost/accumulators/numeric/functional.hpp index 858decc1..346a6e55 100644 --- a/upstream/boost/boost/accumulators/numeric/functional.hpp +++ b/upstream/boost/boost/accumulators/numeric/functional.hpp @@ -437,26 +437,23 @@ namespace boost { namespace numeric {}; } - namespace - { - op::min_assign const &min_assign = boost::detail::pod_singleton::instance; - op::max_assign const &max_assign = boost::detail::pod_singleton::instance; - op::fdiv const &fdiv = boost::detail::pod_singleton::instance; - op::fdiv const &average = boost::detail::pod_singleton::instance; ///< INTERNAL ONLY - op::as_min const &as_min = boost::detail::pod_singleton::instance; - op::as_max const &as_max = boost::detail::pod_singleton::instance; - op::as_zero const &as_zero = boost::detail::pod_singleton::instance; - op::as_one const &as_one = boost::detail::pod_singleton::instance; - - BOOST_ACCUMULATORS_IGNORE_GLOBAL(min_assign) - BOOST_ACCUMULATORS_IGNORE_GLOBAL(max_assign) - BOOST_ACCUMULATORS_IGNORE_GLOBAL(fdiv) - BOOST_ACCUMULATORS_IGNORE_GLOBAL(average) - BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_min) - BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_max) - BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) - BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) - } + inline op::min_assign const &min_assign = boost::detail::pod_singleton::instance; + inline op::max_assign const &max_assign = boost::detail::pod_singleton::instance; + inline op::fdiv const &fdiv = boost::detail::pod_singleton::instance; + inline op::fdiv const &average = boost::detail::pod_singleton::instance; ///< INTERNAL ONLY + inline op::as_min const &as_min = boost::detail::pod_singleton::instance; + inline op::as_max const &as_max = boost::detail::pod_singleton::instance; + inline op::as_zero const &as_zero = boost::detail::pod_singleton::instance; + inline op::as_one const &as_one = boost::detail::pod_singleton::instance; + + BOOST_ACCUMULATORS_IGNORE_GLOBAL(min_assign) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(max_assign) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(fdiv) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(average) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_min) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_max) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) /////////////////////////////////////////////////////////////////////////////// // promote diff --git a/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp b/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp index 501f654b..fdb01a7b 100644 --- a/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp +++ b/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp @@ -182,16 +182,13 @@ namespace boost { namespace numeric struct as_one; } - namespace - { - extern op::min_assign const &min_assign; - extern op::max_assign const &max_assign; - extern op::fdiv const &fdiv; - extern op::as_min const &as_min; - extern op::as_max const &as_max; - extern op::as_zero const &as_zero; - extern op::as_one const &as_one; - } + extern op::min_assign const &min_assign; + extern op::max_assign const &max_assign; + extern op::fdiv const &fdiv; + extern op::as_min const &as_min; + extern op::as_max const &as_max; + extern op::as_zero const &as_zero; + extern op::as_one const &as_one; template typename lazy_disable_if, mpl::if_, To &, To> >::type diff --git a/upstream/boost/boost/bloom/detail/fast_multiblock32_sse2.hpp b/upstream/boost/boost/bloom/detail/fast_multiblock32_sse2.hpp index f90d9e21..771853c2 100644 --- a/upstream/boost/boost/bloom/detail/fast_multiblock32_sse2.hpp +++ b/upstream/boost/boost/bloom/detail/fast_multiblock32_sse2.hpp @@ -37,7 +37,7 @@ struct m128ix2 }; /* NOLINTNEXTLINE(readability-redundant-inline-specifier) */ -static inline int mm_testc_si128(__m128i x,__m128i y) +inline int mm_testc_si128(__m128i x,__m128i y) { #ifdef __SSE4_1__ return _mm_testc_si128(x,y); diff --git a/upstream/boost/boost/interprocess/detail/os_file_functions.hpp b/upstream/boost/boost/interprocess/detail/os_file_functions.hpp index 137409da..92dfc70d 100644 --- a/upstream/boost/boost/interprocess/detail/os_file_functions.hpp +++ b/upstream/boost/boost/interprocess/detail/os_file_functions.hpp @@ -76,7 +76,7 @@ typedef enum { file_begin = winapi::file_begin } file_pos_t; typedef unsigned long map_options_t; -static const map_options_t default_map_options = map_options_t(-1); +BOOST_INLINE_CONSTEXPR map_options_t default_map_options = map_options_t(-1); namespace ipcdetail{ @@ -491,7 +491,7 @@ typedef enum { file_begin = SEEK_SET } file_pos_t; typedef int map_options_t; -static const map_options_t default_map_options = map_options_t(-1); +BOOST_INLINE_CONSTEXPR map_options_t default_map_options = map_options_t(-1); namespace ipcdetail{ diff --git a/upstream/boost/boost/openmethod/core.hpp b/upstream/boost/boost/openmethod/core.hpp index 7c2d3837..acdec46e 100644 --- a/upstream/boost/boost/openmethod/core.hpp +++ b/upstream/boost/boost/openmethod/core.hpp @@ -2263,7 +2263,7 @@ class method //! @tparam Fn One or more functions to the overrider list template class override { - std::tuple...> impl; + std::tuple>...> impl; }; private: diff --git a/upstream/boost/boost/serialization/singleton.hpp b/upstream/boost/boost/serialization/singleton.hpp index e2c78a15..6f2328ed 100644 --- a/upstream/boost/boost/serialization/singleton.hpp +++ b/upstream/boost/boost/serialization/singleton.hpp @@ -118,7 +118,7 @@ class BOOST_SYMBOL_VISIBLE singleton_module : } }; -static inline singleton_module & get_singleton_module(){ +inline singleton_module & get_singleton_module(){ static singleton_module m; return m; } diff --git a/upstream/boost/boost/sort/common/util/algorithm.hpp b/upstream/boost/boost/sort/common/util/algorithm.hpp index 3711cce5..94fcc18a 100644 --- a/upstream/boost/boost/sort/common/util/algorithm.hpp +++ b/upstream/boost/boost/sort/common/util/algorithm.hpp @@ -47,7 +47,7 @@ namespace util // //---------------------------------------------------------------------------- // -// static inline uint32_t nbits32 (uint32_t num) noexcept +// inline uint32_t nbits32 (uint32_t num) noexcept // // static inline uint32_t nbits64 (uint64_t num) // @@ -111,7 +111,7 @@ static constexpr const uint32_t tmsb[256] = /// @param num : Number to examine /// @return Number of bits //--------------------------------------------------------------------------- -static inline uint32_t nbits32 (uint32_t num) noexcept +inline uint32_t nbits32 (uint32_t num) noexcept { int Pos = (num & 0xffff0000U) ? 16 : 0; if ((num >> Pos) & 0xff00U) Pos += 8; @@ -125,7 +125,7 @@ static inline uint32_t nbits32 (uint32_t num) noexcept /// @exception none /// @return Number of bits //--------------------------------------------------------------------------- -static inline uint32_t nbits64(uint64_t num)noexcept +inline uint32_t nbits64(uint64_t num)noexcept { uint32_t Pos = (num & 0xffffffff00000000ULL) ? 32 : 0; if ((num >> Pos) & 0xffff0000ULL) Pos += 16; diff --git a/upstream/boost/boost/unordered/detail/foa/core.hpp b/upstream/boost/boost/unordered/detail/foa/core.hpp index a1ccdc17..b196869a 100644 --- a/upstream/boost/boost/unordered/detail/foa/core.hpp +++ b/upstream/boost/boost/unordered/detail/foa/core.hpp @@ -148,7 +148,7 @@ namespace unordered{ namespace detail{ namespace foa{ -static constexpr std::size_t default_bucket_count=0; +inline constexpr std::size_t default_bucket_count=0; /* foa::table_core is the common base of foa::table and foa::concurrent_table, * which in their turn serve as the foundational core of diff --git a/upstream/boost/boost/unordered/detail/implementation.hpp b/upstream/boost/boost/unordered/detail/implementation.hpp index 16e36493..295a2677 100644 --- a/upstream/boost/boost/unordered/detail/implementation.hpp +++ b/upstream/boost/boost/unordered/detail/implementation.hpp @@ -93,7 +93,7 @@ namespace boost { template struct table; static const float minimum_max_load_factor = 1e-3f; - static const std::size_t default_bucket_count = 0; + BOOST_INLINE_CONSTEXPR std::size_t default_bucket_count = 0; struct move_tag { diff --git a/upstream/boost/boost/url/grammar/type_traits.hpp b/upstream/boost/boost/url/grammar/type_traits.hpp index ff2e7b5c..e91b7c01 100644 --- a/upstream/boost/boost/url/grammar/type_traits.hpp +++ b/upstream/boost/boost/url/grammar/type_traits.hpp @@ -116,6 +116,13 @@ using is_rule = implementation_defined::is_rule; @ref parse, @ref is_rule. */ +#if defined(BOOST_MSVC) +// MSVC's C++20 module IFC serializer drops `const` from `char const*&` in a +// concept requires-parameter list, making Rule evaluate to false for every +// rule imported from mcpplibs.mwrap.boost.url. Delegate to is_rule. +template +concept Rule = is_rule::value; +#else template concept Rule = requires (T t, char const*& it, char const* end) @@ -124,6 +131,7 @@ concept Rule = { t.parse(it, end) } -> std::same_as>; }; #endif +#endif } // grammar diff --git a/upstream/boost/boost/url/static_url.hpp b/upstream/boost/boost/url/static_url.hpp index e5282d9f..b966bf44 100644 --- a/upstream/boost/boost/url/static_url.hpp +++ b/upstream/boost/boost/url/static_url.hpp @@ -55,6 +55,7 @@ class BOOST_SYMBOL_VISIBLE static_url_base template friend class static_url; +protected: ~static_url_base() = default; static_url_base( char* buf, std::size_t cap) noexcept; diff --git a/upstream/boost/boost/url/url_base.hpp b/upstream/boost/boost/url/url_base.hpp index 27973a0b..eaccf866 100644 --- a/upstream/boost/boost/url/url_base.hpp +++ b/upstream/boost/boost/url/url_base.hpp @@ -87,6 +87,7 @@ class BOOST_SYMBOL_VISIBLE url_base char* old = nullptr; }; +protected: virtual ~url_base() noexcept = default; url_base() noexcept = default; url_base(detail::url_impl const&) noexcept; diff --git a/upstream/boost/boost/url/url_view_base.hpp b/upstream/boost/boost/url/url_view_base.hpp index 7d59598c..1b81eb42 100644 --- a/upstream/boost/boost/url/url_view_base.hpp +++ b/upstream/boost/boost/url/url_view_base.hpp @@ -112,6 +112,7 @@ class BOOST_SYMBOL_VISIBLE url_view_base { } +protected: ~url_view_base() = default; BOOST_URL_CXX14_CONSTEXPR From 52f5c6f1fbff5c6a65bf17e9fc2bd3268a079ed9 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 07:53:33 +0000 Subject: [PATCH 14/21] fix(asio): keep executor query/require public under BOOST_ASIO_MSVC for IFC friend bug --- patches/asio.patch | 135 ++++++++++++++++++ upstream/boost/boost/asio/inline_executor.hpp | 6 +- .../boost/boost/asio/inline_or_executor.hpp | 6 +- upstream/boost/boost/asio/io_context.hpp | 6 +- upstream/boost/boost/asio/system_executor.hpp | 6 +- upstream/boost/boost/asio/thread_pool.hpp | 6 +- 6 files changed, 150 insertions(+), 15 deletions(-) diff --git a/patches/asio.patch b/patches/asio.patch index 1df0c3b0..36ada4ec 100644 --- a/patches/asio.patch +++ b/patches/asio.patch @@ -24,3 +24,138 @@ index 908c6f6d..4a53a8b8 100644 } // namespace detail BOOST_ASIO_INLINE_NAMESPACE_END +diff --git a/upstream/boost/boost/asio/inline_executor.hpp b/upstream/boost/boost/asio/inline_executor.hpp +index 272ed215..acd5ba02 100644 +--- a/upstream/boost/boost/asio/inline_executor.hpp ++++ b/upstream/boost/boost/asio/inline_executor.hpp +@@ -36,11 +36,11 @@ public: + { + } + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; + friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; +-#endif // !defined(GENERATING_DOCUMENTATION) ++#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + + /// Obtain an executor with the @c inline_exception_handling.propagate + /// property. +@@ -78,7 +78,7 @@ private: + execution::inline_exception_handling_t::terminate_t>(); + } + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; + friend struct boost::asio::execution::detail::blocking_t<0>; +diff --git a/upstream/boost/boost/asio/inline_or_executor.hpp b/upstream/boost/boost/asio/inline_or_executor.hpp +index a8fb0d21..331e6537 100644 +--- a/upstream/boost/boost/asio/inline_or_executor.hpp ++++ b/upstream/boost/boost/asio/inline_or_executor.hpp +@@ -188,11 +188,11 @@ public: + } + #endif // !defined(BOOST_ASIO_NO_TS_EXECUTORS) + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; + friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; +-#endif // !defined(GENERATING_DOCUMENTATION) ++#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + + /// Obtain an executor with the @c blocking.possibly property. + /** +@@ -348,7 +348,7 @@ private: + Blocking, InlineExceptionHandling>(boost::asio::prefer(executor_, p)); + } + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; + friend struct boost::asio::execution::detail::blocking_t<0>; +diff --git a/upstream/boost/boost/asio/io_context.hpp b/upstream/boost/boost/asio/io_context.hpp +index 7a030e9f..76b160ba 100644 +--- a/upstream/boost/boost/asio/io_context.hpp ++++ b/upstream/boost/boost/asio/io_context.hpp +@@ -568,11 +568,11 @@ public: + /// Move assignment operator. + basic_executor_type& operator=(basic_executor_type&& other) noexcept; + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; + friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; +-#endif // !defined(GENERATING_DOCUMENTATION) ++#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + + /// Obtain an executor with the @c blocking.possibly property. + /** +@@ -710,7 +710,7 @@ private: + context_ptr(), std::allocator(), bits()); + } + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; + friend struct boost::asio::execution::detail::mapping_t<0>; +diff --git a/upstream/boost/boost/asio/system_executor.hpp b/upstream/boost/boost/asio/system_executor.hpp +index 58ad3228..3b02c227 100644 +--- a/upstream/boost/boost/asio/system_executor.hpp ++++ b/upstream/boost/boost/asio/system_executor.hpp +@@ -46,11 +46,11 @@ public: + { + } + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; + friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; +-#endif // !defined(GENERATING_DOCUMENTATION) ++#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + + /// Obtain an executor with the @c blocking.possibly property. + /** +@@ -177,7 +177,7 @@ private: + Relationship, std::allocator>(); + } + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; + friend struct boost::asio::execution::detail::blocking_t<0>; +diff --git a/upstream/boost/boost/asio/thread_pool.hpp b/upstream/boost/boost/asio/thread_pool.hpp +index 61a9c242..2cdd3147 100644 +--- a/upstream/boost/boost/asio/thread_pool.hpp ++++ b/upstream/boost/boost/asio/thread_pool.hpp +@@ -274,11 +274,11 @@ public: + /// Move assignment operator. + basic_executor_type& operator=(basic_executor_type&& other) noexcept; + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; + friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; +-#endif // !defined(GENERATING_DOCUMENTATION) ++#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + + /// Obtain an executor with the @c blocking.possibly property. + /** +@@ -439,7 +439,7 @@ private: + pool_, std::allocator(), bits_); + } + +-#if !defined(GENERATING_DOCUMENTATION) ++#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) + private: + friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; + friend struct boost::asio::execution::detail::mapping_t<0>; diff --git a/upstream/boost/boost/asio/inline_executor.hpp b/upstream/boost/boost/asio/inline_executor.hpp index 272ed215..acd5ba02 100644 --- a/upstream/boost/boost/asio/inline_executor.hpp +++ b/upstream/boost/boost/asio/inline_executor.hpp @@ -36,11 +36,11 @@ class basic_inline_executor { } -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; -#endif // !defined(GENERATING_DOCUMENTATION) +#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) /// Obtain an executor with the @c inline_exception_handling.propagate /// property. @@ -78,7 +78,7 @@ class basic_inline_executor execution::inline_exception_handling_t::terminate_t>(); } -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; friend struct boost::asio::execution::detail::blocking_t<0>; diff --git a/upstream/boost/boost/asio/inline_or_executor.hpp b/upstream/boost/boost/asio/inline_or_executor.hpp index a8fb0d21..331e6537 100644 --- a/upstream/boost/boost/asio/inline_or_executor.hpp +++ b/upstream/boost/boost/asio/inline_or_executor.hpp @@ -188,11 +188,11 @@ class inline_or_executor } #endif // !defined(BOOST_ASIO_NO_TS_EXECUTORS) -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; -#endif // !defined(GENERATING_DOCUMENTATION) +#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) /// Obtain an executor with the @c blocking.possibly property. /** @@ -348,7 +348,7 @@ class inline_or_executor Blocking, InlineExceptionHandling>(boost::asio::prefer(executor_, p)); } -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; friend struct boost::asio::execution::detail::blocking_t<0>; diff --git a/upstream/boost/boost/asio/io_context.hpp b/upstream/boost/boost/asio/io_context.hpp index 7a030e9f..76b160ba 100644 --- a/upstream/boost/boost/asio/io_context.hpp +++ b/upstream/boost/boost/asio/io_context.hpp @@ -568,11 +568,11 @@ class io_context::basic_executor_type : /// Move assignment operator. basic_executor_type& operator=(basic_executor_type&& other) noexcept; -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; -#endif // !defined(GENERATING_DOCUMENTATION) +#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) /// Obtain an executor with the @c blocking.possibly property. /** @@ -710,7 +710,7 @@ class io_context::basic_executor_type : context_ptr(), std::allocator(), bits()); } -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; friend struct boost::asio::execution::detail::mapping_t<0>; diff --git a/upstream/boost/boost/asio/system_executor.hpp b/upstream/boost/boost/asio/system_executor.hpp index 58ad3228..3b02c227 100644 --- a/upstream/boost/boost/asio/system_executor.hpp +++ b/upstream/boost/boost/asio/system_executor.hpp @@ -46,11 +46,11 @@ class basic_system_executor { } -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; -#endif // !defined(GENERATING_DOCUMENTATION) +#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) /// Obtain an executor with the @c blocking.possibly property. /** @@ -177,7 +177,7 @@ class basic_system_executor Relationship, std::allocator>(); } -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; friend struct boost::asio::execution::detail::blocking_t<0>; diff --git a/upstream/boost/boost/asio/thread_pool.hpp b/upstream/boost/boost/asio/thread_pool.hpp index 61a9c242..2cdd3147 100644 --- a/upstream/boost/boost/asio/thread_pool.hpp +++ b/upstream/boost/boost/asio/thread_pool.hpp @@ -274,11 +274,11 @@ class thread_pool::basic_executor_type : detail::thread_pool_bits /// Move assignment operator. basic_executor_type& operator=(basic_executor_type&& other) noexcept; -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(require_fn)::impl; friend struct BOOST_ASIO_VERSIONED_NAME(prefer_fn)::impl; -#endif // !defined(GENERATING_DOCUMENTATION) +#endif // !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) /// Obtain an executor with the @c blocking.possibly property. /** @@ -439,7 +439,7 @@ class thread_pool::basic_executor_type : detail::thread_pool_bits pool_, std::allocator(), bits_); } -#if !defined(GENERATING_DOCUMENTATION) +#if !defined(GENERATING_DOCUMENTATION) && !defined(BOOST_ASIO_MSVC) private: friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; friend struct boost::asio::execution::detail::mapping_t<0>; From 1d18858f3f6022bd341c518b7ae22061264998cb Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 07:53:33 +0000 Subject: [PATCH 15/21] docs: record MSVC test suite adaptations in patches/README and design doc --- ...2-04-windows-msvc-ci-adaptations-design.md | 23 +++++++++++++++++++ patches/README.md | 22 ++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md b/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md index 2970ba28..fc5de78d 100644 --- a/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md +++ b/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md @@ -149,6 +149,29 @@ Windows SDK 10.0.26100.0)。 参照 GCC 的既有做法从根模块 `:closure` 中略过 `mcpplibs.mwrap.boost.sort` 并输出警告; 直接 `import mcpplibs.mwrap.boost.sort;` 不受影响。 +### 7. 原生 MSVC 测试套件适配(链接参数、`/bigobj`、内部链接与 IFC `friend`/概念缺陷) + +全部 120 个库模块编译通过后,测试套件在原生 MSVC 暴露出 6 类问题并已一并修复: + +1. **链接参数与 `/bigobj`(`mcpp.toml`)**: + - `link.exe` 不接受 `-lws2_32` 等 GNU 风格参数(`LNK4044` 导致全部测试链接失败 `LNK2019`); + 将 Windows 链接参数按 `compiler = "msvc"`(使用 `*.lib`)与 `not(compiler = "msvc")`(保留 `-l*`)拆分。 + - 重模板测试(`tests/geometry/examples_algorithms.cpp`、`tests/math/examples_1.cpp`)超 COFF 节数上限(`C1128`),在 `[target.'cfg(compiler = "msvc")'.build].cxxflags` 补充 `/bigobj`。 +2. **内部链接函数/常量提升(`bloom`、`sort`、`unordered`、`interprocess`、`serialization`、`accumulators` 补丁)**: + - 原生 MSVC C++20 模块要求被导出模板引用的辅助函数/常量具备外部链接,否则报 `C2129` / `C7631` / `C2039` / `C2065`。 + - 将 `mm_testc_si128`(补 `BOOST_BLOOM_SSE2` guard)、`nbits32`/`nbits64`、`get_singleton_module` 从 `static inline` 改为 `inline`;将 `default_bucket_count`、`default_map_options` 改为 `BOOST_INLINE_CONSTEXPR`/`inline constexpr`;将 `boost::numeric::{min_assign,max_assign,fdiv,average,as_min,as_max,as_zero,as_one}` 从匿名命名空间移出并声明为 `inline`。 +3. **MSVC IFC `friend` 丢失(`asio.patch`、`url.patch`)**: + - 原生 MSVC 14.52 反序列化 `.ifc` 时丢失 GMF 类上的 `friend` 授权: + - `boost::asio` 的 5 个执行器头文件(`io_context.hpp`、`thread_pool.hpp`、`system_executor.hpp`、`inline_executor.hpp`、`inline_or_executor.hpp`)将 `query`/`require` 置于 `private:` 并通过 `friend struct asio_*_fn::impl` 授权,导致 `query_member`/`require_member` 全部失效(影响 20 个 asio/beast/cobalt/mqtt5 测试)。在 `BOOST_ASIO_MSVC` 下保持其为 `public:`(与 `GENERATING_DOCUMENTATION` 一致)。 + - `boost::urls::{url_view_base,url_base,static_url_base}` 的析构函数为 `private:` + `friend class Derived`,导致 `~url_view()` 被判为 deleted(`C2280`/`C2282`);改为 `protected:`。 +4. **MSVC IFC `concept` 丢 `const`(`url.patch`)**: + - `boost::urls::grammar::Rule` 的 `requires (T t, char const*& it, char const* end)` 经 `.ifc` 反序列化后丢失 `const`(变成 `char*`),导致全部 `grammar::parse`/`squelch`/`tuple_rule` 约束失败。在 `BOOST_MSVC` 下改为 `concept Rule = is_rule::value;`。 +5. **`property_tree` 补齐 `multi_index` 依赖**: + - `tests/property_tree.cpp` 需经 ADL 找到 `boost::multi_index::detail::operator==`;在 `tools/export_policy.toml` 新增 `[property_tree.deps] add = ["multi_index"]` 并在 `src/property_tree.cppm` 补充 `export import`。 +6. **`openmethod` 与 `statechart` 测试**: + - `patches/openmethod.patch` 在 `boost/openmethod/core.hpp` 使用 `std::decay_t` 以在 MSVC 14.52 匹配函数指针偏特化。 + - `tests/statechart.cpp` 将 `#include ` 移至 `import` 之前,消除默认模板实参重定义(`C2572`)。 + ## 待跟进事项 1. **全量 CI 测试与示例验证**:等待 `group A` / `group B` 全部模块编译与测试运行通过, diff --git a/patches/README.md b/patches/README.md index 6ac87354..62475bf2 100644 --- a/patches/README.md +++ b/patches/README.md @@ -130,3 +130,25 @@ C1001`, `msc1.cpp:1678`). Disabling the macro on `BOOST_MSVC` selects upstream's direct-CRTP fallback without affecting GCC or Clang (`clang-cl` does not define `BOOST_MSVC`); the 13 helper symbols declared only under that macro are guarded in `tools/export_policy.toml`. + +`bloom.patch`, `sort.patch`, `unordered.patch`, and the MSVC-module additions to +`accumulators.patch`, `interprocess.patch`, and `serialization.patch` promote +internal-linkage `static inline` functions (`mm_testc_si128`, `nbits32`, +`nbits64`, `get_singleton_module`), `static const` defaults +(`default_bucket_count`, `default_map_options`), and anonymous-namespace +references (`boost::numeric::{min_assign,max_assign,fdiv,average,as_min,as_max,as_zero,as_one}`) +to `inline` / `BOOST_INLINE_CONSTEXPR` so native MSVC C++20 modules can emit +and reference them from imported templates (`C2129` / `C7631` / `C2039` / `C2065`). + +`openmethod.patch` passes `std::decay_t` to `override_aux` in +`boost/openmethod/core.hpp` so MSVC 14.52 matches the function-pointer partial +specialization. + +`asio.patch` and `url.patch` also work around two native MSVC 14.52 C++20 +module IFC bugs: `friend` declarations on GMF classes are not preserved across +IFC import (breaking `private:` `query`/`require` on Asio executors and +`private:` destructors on `url_view_base`/`url_base`/`static_url_base`, so the +former stay `public:` under `BOOST_ASIO_MSVC` and the latter become +`protected:`), and MSVC's IFC serializer drops `const` from `char const*&` in +`boost::urls::grammar::Rule`'s `requires` parameter list (delegated to +`is_rule::value` under `BOOST_MSVC`). From 55e9a9051c91fbf614ef9c5a1a2bf80d4fd4b815 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 08:48:08 +0000 Subject: [PATCH 16/21] fix(msvc,gcc): fix asio proxies, url base, accumulators ops, inline constexpr link errors, and test expectations --- generated/exports/accumulators.inc | 18 +- generated/exports/charconv.inc | 6 +- generated/exports/decimal.inc | 21 +- generated/exports/histogram.inc | 6 +- generated/exports/json.inc | 4 +- generated/exports/math.inc | 18 +- generated/exports/move.inc | 3 +- generated/exports/sort.inc | 3 +- generated/exports/system.inc | 3 +- generated/exports/url.inc | 32 +- generated/meta/api-surface.json | 20 +- mcpp.toml | 2 +- patches/accumulators.patch | 158 +++++-- patches/asio.patch | 233 +++++++++++ patches/charconv.patch | 44 ++ patches/decimal.patch | 39 ++ patches/histogram.patch | 19 + patches/json.patch | 22 + patches/math.patch | 79 ++++ patches/move.patch | 13 + patches/sort.patch | 13 + patches/system.patch | 6 +- patches/url.patch | 390 +++++++++++++++++- tests/describe/include_examples.cpp | 8 +- .../example/test_case_template_example.cpp | 3 + tools/apply_patches.py | 6 +- .../boost/accumulators/numeric/functional.hpp | 45 +- .../accumulators/numeric/functional_fwd.hpp | 35 +- .../boost/boost/asio/execution/allocator.hpp | 4 +- .../boost/boost/asio/execution/blocking.hpp | 4 +- .../asio/execution/blocking_adaptation.hpp | 4 +- .../boost/boost/asio/execution/context.hpp | 2 +- .../execution/inline_exception_handling.hpp | 4 +- .../boost/boost/asio/execution/mapping.hpp | 4 +- .../boost/boost/asio/execution/occupancy.hpp | 2 +- .../boost/asio/execution/outstanding_work.hpp | 4 +- .../boost/asio/execution/relationship.hpp | 4 +- upstream/boost/boost/asio/prefer.hpp | 3 +- upstream/boost/boost/asio/query.hpp | 2 +- upstream/boost/boost/asio/require.hpp | 2 +- upstream/boost/boost/asio/require_concept.hpp | 2 +- .../detail/from_chars_integer_impl.hpp | 4 +- .../charconv/detail/to_chars_integer_impl.hpp | 4 +- .../decimal/detail/cmath/impl/sqrt_lookup.hpp | 4 +- .../decimal/detail/int128/detail/config.hpp | 6 +- .../boost/boost/histogram/axis/option.hpp | 8 +- upstream/boost/boost/json/detail/literals.hpp | 4 +- .../detail/lambert_w_lookup_table.ipp | 26 +- .../move/algo/detail/adaptive_sort_merge.hpp | 2 +- .../boost/sort/common/util/algorithm.hpp | 2 +- .../boost/boost/system/detail/error_code.hpp | 6 +- upstream/boost/boost/url/detail/encode.hpp | 2 +- .../url/detail/replacement_field_rule.hpp | 8 +- upstream/boost/boost/url/detail/url_impl.hpp | 2 +- upstream/boost/boost/url/impl/url_view.hpp | 10 +- .../boost/boost/url/rfc/detail/charsets.hpp | 28 +- .../url/rfc/detail/fragment_part_rule.hpp | 2 +- .../boost/boost/url/rfc/detail/h16_rule.hpp | 2 +- .../boost/url/rfc/detail/hier_part_rule.hpp | 2 +- .../boost/boost/url/rfc/detail/host_rule.hpp | 2 +- .../boost/url/rfc/detail/ip_literal_rule.hpp | 2 +- .../boost/url/rfc/detail/ipv6_addrz_rule.hpp | 2 +- .../boost/url/rfc/detail/ipvfuture_rule.hpp | 2 +- .../boost/boost/url/rfc/detail/path_rules.hpp | 2 +- .../boost/boost/url/rfc/detail/port_rule.hpp | 2 +- .../boost/url/rfc/detail/query_part_rule.hpp | 2 +- .../boost/url/rfc/detail/reg_name_rule.hpp | 2 +- .../url/rfc/detail/relative_part_rule.hpp | 2 +- .../boost/url/rfc/detail/userinfo_rule.hpp | 2 +- upstream/boost/boost/url/url_view_base.hpp | 6 +- 70 files changed, 1246 insertions(+), 192 deletions(-) create mode 100644 patches/charconv.patch create mode 100644 patches/decimal.patch create mode 100644 patches/histogram.patch create mode 100644 patches/move.patch diff --git a/generated/exports/accumulators.inc b/generated/exports/accumulators.inc index ea3bed84..ada6c3f9 100644 --- a/generated/exports/accumulators.inc +++ b/generated/exports/accumulators.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=accumulators boost=1.92.0 target=x86_64-w64-mingw32 entities=727 +// lib=accumulators boost=1.92.0 target=x86_64-w64-mingw32 entities=711 export namespace boost { namespace accumulators { using boost::accumulators::absolute; @@ -596,15 +596,7 @@ export namespace boost { namespace mpl { namespace aux { }}} export namespace boost { namespace numeric { - using boost::numeric::as_max; - using boost::numeric::as_min; - using boost::numeric::as_one; - using boost::numeric::as_zero; - using boost::numeric::average; using boost::numeric::default_; - using boost::numeric::fdiv; - using boost::numeric::max_assign; - using boost::numeric::min_assign; using boost::numeric::one; using boost::numeric::one_or_default; using boost::numeric::pow; @@ -614,22 +606,14 @@ export namespace boost { namespace numeric { }} export namespace boost { namespace numeric { namespace detail { - using boost::numeric::detail::ignore_as_max; - using boost::numeric::detail::ignore_as_min; - using boost::numeric::detail::ignore_as_one; - using boost::numeric::detail::ignore_as_zero; using boost::numeric::detail::ignore_assign; - using boost::numeric::detail::ignore_average; using boost::numeric::detail::ignore_divides; using boost::numeric::detail::ignore_divides_assign; using boost::numeric::detail::ignore_equal_to; - using boost::numeric::detail::ignore_fdiv; using boost::numeric::detail::ignore_greater; using boost::numeric::detail::ignore_greater_equal; using boost::numeric::detail::ignore_less; using boost::numeric::detail::ignore_less_equal; - using boost::numeric::detail::ignore_max_assign; - using boost::numeric::detail::ignore_min_assign; using boost::numeric::detail::ignore_minus; using boost::numeric::detail::ignore_minus_assign; using boost::numeric::detail::ignore_modulus; diff --git a/generated/exports/charconv.inc b/generated/exports/charconv.inc index 4af9ecba..58efe92c 100644 --- a/generated/exports/charconv.inc +++ b/generated/exports/charconv.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=charconv boost=1.92.0 target=x86_64-w64-mingw32 entities=61 +// lib=charconv boost=1.92.0 target=x86_64-w64-mingw32 entities=65 export namespace boost { namespace charconv { using boost::charconv::chars_format; @@ -19,6 +19,7 @@ export namespace boost { namespace charconv { namespace detail { using boost::charconv::detail::brainfloat16; using boost::charconv::detail::decompose32; using boost::charconv::detail::digit_from_char; + using boost::charconv::detail::digit_table; using boost::charconv::detail::div_impl; using boost::charconv::detail::exp_digits; using boost::charconv::detail::from_chars; @@ -38,6 +39,7 @@ export namespace boost { namespace charconv { namespace detail { using boost::charconv::detail::is_int128; using boost::charconv::detail::is_signed; using boost::charconv::detail::is_uint128; + using boost::charconv::detail::log_2_table; using boost::charconv::detail::make_signed; using boost::charconv::detail::make_unsigned; using boost::charconv::detail::make_unsigned_t; @@ -58,6 +60,7 @@ export namespace boost { namespace charconv { namespace detail { using boost::charconv::detail::operator^; using boost::charconv::detail::operator|; using boost::charconv::detail::operator~; + using boost::charconv::detail::radix_table; #if defined(BOOST_CHARCONV_HAS_INT128) // M11 platform guard: to_chars128 exists only under BOOST_CHARCONV_HAS_INT128 // (to_chars_integer_impl.hpp). @@ -67,6 +70,7 @@ export namespace boost { namespace charconv { namespace detail { using boost::charconv::detail::to_chars_int; using boost::charconv::detail::to_chars_integer_impl; using boost::charconv::detail::trivial_uint128; + using boost::charconv::detail::uchar_values; using boost::charconv::detail::uint128; using boost::charconv::detail::umul128; using boost::charconv::detail::umul128_upper64; diff --git a/generated/exports/decimal.inc b/generated/exports/decimal.inc index bd3b42aa..f72571e1 100644 --- a/generated/exports/decimal.inc +++ b/generated/exports/decimal.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=decimal boost=1.92.0 target=x86_64-w64-mingw32 entities=914 +// lib=decimal boost=1.92.0 target=x86_64-w64-mingw32 entities=930 export namespace boost { namespace decimal { using boost::decimal::_boost_decimal_global_rounding_mode; @@ -826,6 +826,11 @@ export namespace boost { namespace decimal { namespace detail { namespace sinh_d using boost::decimal::detail::sinh_detail::sinh_table_imp; }}}} +export namespace boost { namespace decimal { namespace detail { namespace sqrt_lookup { + using boost::decimal::detail::sqrt_lookup::recip_sqrt_k0s; + using boost::decimal::detail::sqrt_lookup::recip_sqrt_k1s; +}}}} + export namespace boost { namespace decimal { namespace detail { namespace tanh_detail { using boost::decimal::detail::tanh_detail::tanh_table_imp; }}}} @@ -979,14 +984,23 @@ export namespace boost { namespace int128 { namespace detail { using boost::int128::detail::half_word_div; using boost::int128::detail::intrinsic_ls_impl; using boost::int128::detail::intrinsic_rs_impl; + using boost::int128::detail::is_any_integer_v; + using boost::int128::detail::is_reduced_integer_v; + using boost::int128::detail::is_signed_integer_v; + using boost::int128::detail::is_streamable_overload_v; + using boost::int128::detail::is_unsigned_integer_v; + using boost::int128::detail::is_valid_overload_v; using boost::int128::detail::knuth_div; using boost::int128::detail::knuth_multiply; using boost::int128::detail::library_add; using boost::int128::detail::library_mul; using boost::int128::detail::library_sub; + using boost::int128::detail::low_word_mask; + using boost::int128::detail::lower_case_digit_table; using boost::int128::detail::mini_to_chars; using boost::int128::detail::numeric_limits_impl_i128; using boost::int128::detail::numeric_limits_impl_u128; + using boost::int128::detail::offset_value_v; using boost::int128::detail::one_word_div; using boost::int128::detail::reduced_integers; using boost::int128::detail::signed_integer; @@ -995,6 +1009,7 @@ export namespace boost { namespace int128 { namespace detail { using boost::int128::detail::strlen; using boost::int128::detail::to_words; using boost::int128::detail::unsigned_integer; + using boost::int128::detail::upper_case_digit_table; using boost::int128::detail::valid_overload; }}} @@ -1002,7 +1017,9 @@ export namespace boost { namespace int128 { namespace detail { namespace impl { using boost::int128::detail::impl::backup_countl_impl; using boost::int128::detail::impl::bit_scan_reverse; using boost::int128::detail::impl::countl_impl; + using boost::int128::detail::impl::countl_mod37; using boost::int128::detail::impl::countr_impl; + using boost::int128::detail::impl::countr_mod37; using boost::int128::detail::impl::digit_from_char; #if defined(BOOST_DECIMAL_DETAIL_INT128_HAS_FAST_DIV128) // The 128-bit division intrinsics are declared only where @@ -1011,6 +1028,7 @@ export namespace boost { namespace int128 { namespace detail { namespace impl { #endif using boost::int128::detail::impl::from_chars_integer_impl; using boost::int128::detail::impl::from_words; + using boost::int128::detail::impl::index64; #if defined(BOOST_DECIMAL_DETAIL_INT128_HAS_FAST_DIV128) // The 128-bit division intrinsics are declared only where // BOOST_DECIMAL_DETAIL_INT128_HAS_FAST_DIV128 (x86-64 gcc/clang). @@ -1027,6 +1045,7 @@ export namespace boost { namespace int128 { namespace detail { namespace impl { using boost::int128::detail::impl::mg32_reciprocal_2by1; #endif using boost::int128::detail::impl::to_words; + using boost::int128::detail::impl::uchar_values; using boost::int128::detail::impl::unpack_u; using boost::int128::detail::impl::unpack_v; }}}} diff --git a/generated/exports/histogram.inc b/generated/exports/histogram.inc index bf93d803..fa3569fa 100644 --- a/generated/exports/histogram.inc +++ b/generated/exports/histogram.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=histogram boost=1.92.0 target=x86_64-w64-mingw32 entities=382 +// lib=histogram boost=1.92.0 target=x86_64-w64-mingw32 entities=386 export namespace boost { namespace accumulators { using boost::accumulators::accumulator_set; @@ -95,13 +95,17 @@ export namespace boost { namespace histogram { namespace axis { export namespace boost { namespace histogram { namespace axis { namespace option { using boost::histogram::axis::option::bit; using boost::histogram::axis::option::bitset; + using boost::histogram::axis::option::circular; using boost::histogram::axis::option::circular_t; + using boost::histogram::axis::option::growth; using boost::histogram::axis::option::growth_t; using boost::histogram::axis::option::none_t; using boost::histogram::axis::option::operator&; using boost::histogram::axis::option::operator-; using boost::histogram::axis::option::operator|; + using boost::histogram::axis::option::overflow; using boost::histogram::axis::option::overflow_t; + using boost::histogram::axis::option::underflow; using boost::histogram::axis::option::underflow_t; }}}} diff --git a/generated/exports/json.inc b/generated/exports/json.inc index a9180243..b9bf362d 100644 --- a/generated/exports/json.inc +++ b/generated/exports/json.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=json boost=1.92.0 target=x86_64-w64-mingw32 entities=308 +// lib=json boost=1.92.0 target=x86_64-w64-mingw32 entities=310 export namespace boost { namespace container_hash { using boost::container_hash::is_unordered_range; @@ -212,6 +212,8 @@ export namespace boost { namespace json { namespace detail { using boost::json::detail::key_type; using boost::json::detail::key_type_helper; using boost::json::detail::literal_index; + using boost::json::detail::literal_sizes; + using boost::json::detail::literal_strings; using boost::json::detail::literals; using boost::json::detail::literals_c; using boost::json::detail::load_little_endian; diff --git a/generated/exports/math.inc b/generated/exports/math.inc index 044036b7..cc562cc1 100644 --- a/generated/exports/math.inc +++ b/generated/exports/math.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=math boost=1.92.0 target=x86_64-w64-mingw32 entities=2862 +// lib=math boost=1.92.0 target=x86_64-w64-mingw32 entities=2875 export namespace boost { using boost::float32_t; @@ -2223,6 +2223,22 @@ export namespace boost { namespace math { namespace lambert_w_detail { using boost::math::lambert_w_detail::schroeder_update; }}} +export namespace boost { namespace math { namespace lambert_w_detail { namespace lambert_w_lookup { + using boost::math::lambert_w_detail::lambert_w_lookup::halves; + using boost::math::lambert_w_detail::lambert_w_lookup::noof_halves; + using boost::math::lambert_w_detail::lambert_w_lookup::noof_sqrts; + using boost::math::lambert_w_detail::lambert_w_lookup::noof_w0es; + using boost::math::lambert_w_detail::lambert_w_lookup::noof_w0zs; + using boost::math::lambert_w_detail::lambert_w_lookup::noof_wm1es; + using boost::math::lambert_w_detail::lambert_w_lookup::noof_wm1zs; + using boost::math::lambert_w_detail::lambert_w_lookup::sqrtw0s; + using boost::math::lambert_w_detail::lambert_w_lookup::sqrtwm1s; + using boost::math::lambert_w_detail::lambert_w_lookup::w0es; + using boost::math::lambert_w_detail::lambert_w_lookup::w0zs; + using boost::math::lambert_w_detail::lambert_w_lookup::wm1es; + using boost::math::lambert_w_detail::lambert_w_lookup::wm1zs; +}}}} + export namespace boost { namespace math { namespace lanczos { using boost::math::lanczos::lanczos; using boost::math::lanczos::lanczos11; diff --git a/generated/exports/move.inc b/generated/exports/move.inc index f94b910d..e833767c 100644 --- a/generated/exports/move.inc +++ b/generated/exports/move.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=move boost=1.92.0 target=x86_64-w64-mingw32 entities=355 +// lib=move boost=1.92.0 target=x86_64-w64-mingw32 entities=356 export namespace boost { using boost::adl_move_iter_swap; @@ -319,6 +319,7 @@ export namespace boost { namespace movelib { namespace detail { }}} export namespace boost { namespace movelib { namespace detail_adaptive { + using boost::movelib::detail_adaptive::AdaptiveSortInsertionSortThreshold; using boost::movelib::detail_adaptive::adaptive_merge_combine_blocks; using boost::movelib::detail_adaptive::adaptive_merge_final_merge; using boost::movelib::detail_adaptive::adaptive_merge_impl; diff --git a/generated/exports/sort.inc b/generated/exports/sort.inc index d94443b1..c30b4e28 100644 --- a/generated/exports/sort.inc +++ b/generated/exports/sort.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=sort boost=1.92.0 target=x86_64-w64-mingw32 entities=162 +// lib=sort boost=1.92.0 target=x86_64-w64-mingw32 entities=163 export namespace boost { namespace sort { using boost::sort::block_indirect_sort; @@ -122,6 +122,7 @@ export namespace boost { namespace sort { namespace common { namespace util { using boost::sort::common::util::nbits32; using boost::sort::common::util::nbits64; using boost::sort::common::util::reverse; + using boost::sort::common::util::tmsb; using boost::sort::common::util::upper_bound; using boost::sort::common::util::value_iter; using std::iterator_traits; diff --git a/generated/exports/system.inc b/generated/exports/system.inc index 32ac1eeb..2e9313b3 100644 --- a/generated/exports/system.inc +++ b/generated/exports/system.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=system boost=1.92.0 target=x86_64-w64-mingw32 entities=198 +// lib=system boost=1.92.0 target=x86_64-w64-mingw32 entities=199 export namespace boost { using boost::throws; @@ -10,6 +10,7 @@ export namespace boost { namespace detail { }} export namespace boost { namespace system { + using boost::system::default_location; using boost::system::error_category; using boost::system::error_code; using boost::system::error_condition; diff --git a/generated/exports/url.inc b/generated/exports/url.inc index e7ca82bc..3201ed06 100644 --- a/generated/exports/url.inc +++ b/generated/exports/url.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=url boost=1.92.0 target=x86_64-w64-mingw32 entities=337 +// lib=url boost=1.92.0 target=x86_64-w64-mingw32 entities=367 export namespace boost { using boost::url; @@ -114,6 +114,8 @@ export namespace boost { namespace urls { namespace detail { using boost::urls::detail::decoded_strcmp; using boost::urls::detail::digest; using boost::urls::detail::digest_encoded; + using boost::urls::detail::empty_c_str_; + using boost::urls::detail::empty_chars; using boost::urls::detail::empty_chars_t; using boost::urls::detail::encode_one; using boost::urls::detail::error_cat; @@ -124,17 +126,27 @@ export namespace boost { namespace urls { namespace detail { using boost::urls::detail::format_context; using boost::urls::detail::format_parse_context; using boost::urls::detail::formatter; + using boost::urls::detail::fragment_chars; + using boost::urls::detail::fragment_part_rule; using boost::urls::detail::fragment_part_rule_t; using boost::urls::detail::get_optional_string; using boost::urls::detail::get_uvalue; using boost::urls::detail::get_width_from_args; + using boost::urls::detail::h16_rule; using boost::urls::detail::h16_rule_t; + using boost::urls::detail::hexdigs; + using boost::urls::detail::hier_part_rule; using boost::urls::detail::hier_part_rule_t; + using boost::urls::detail::host_chars; + using boost::urls::detail::host_rule; using boost::urls::detail::host_rule_t; using boost::urls::detail::ignore_format; using boost::urls::detail::integer_formatter_impl; + using boost::urls::detail::ip_literal_rule; using boost::urls::detail::ip_literal_rule_t; + using boost::urls::detail::ipv6_addrz_rule; using boost::urls::detail::ipv6_addrz_rule_t; + using boost::urls::detail::ipvfuture_rule; using boost::urls::detail::ipvfuture_rule_t; using boost::urls::detail::is_dereferenceable; using boost::urls::detail::is_overlapping; @@ -154,11 +166,14 @@ export namespace boost { namespace urls { namespace detail { using boost::urls::detail::move_chars; using boost::urls::detail::move_chars_impl; using boost::urls::detail::named_arg; + using boost::urls::detail::nocolon_pchars; using boost::urls::detail::normalized_path_digest; using boost::urls::detail::optional_string; using boost::urls::detail::over_allocator; using boost::urls::detail::param_encoded_iter; using boost::urls::detail::param_encoded_value_iter; + using boost::urls::detail::param_key_chars; + using boost::urls::detail::param_value_chars; using boost::urls::detail::param_value_iter; using boost::urls::detail::params_encoded_iter; using boost::urls::detail::params_encoded_iter_base; @@ -167,6 +182,8 @@ export namespace boost { namespace urls { namespace detail { using boost::urls::detail::params_iter_impl; using boost::urls::detail::parse_encoded; using boost::urls::detail::parts_base; + using boost::urls::detail::password_chars; + using boost::urls::detail::path_chars; using boost::urls::detail::path_ends_with; using boost::urls::detail::path_pop_back; using boost::urls::detail::path_prefix; @@ -176,20 +193,29 @@ export namespace boost { namespace urls { namespace detail { using boost::urls::detail::pattern; using boost::urls::detail::pop_encoded_front; using boost::urls::detail::pop_last_segment; + using boost::urls::detail::port_part_rule; using boost::urls::detail::port_part_rule_t; using boost::urls::detail::port_rule; using boost::urls::detail::printed; + using boost::urls::detail::query_chars; + using boost::urls::detail::query_ignore_chars; + using boost::urls::detail::query_part_rule; using boost::urls::detail::query_part_rule_t; using boost::urls::detail::query_ref; using boost::urls::detail::query_string_iter; using boost::urls::detail::re_encode_unsafe; using boost::urls::detail::re_encoded_size_unsafe; using boost::urls::detail::ref; + using boost::urls::detail::reg_name_chars; + using boost::urls::detail::reg_name_rule; + using boost::urls::detail::relative_part_rule; using boost::urls::detail::relative_part_rule_t; using boost::urls::detail::remove_dot_segments; using boost::urls::detail::scheme_rule; + using boost::urls::detail::segment_chars; using boost::urls::detail::segment_encoded_iter; using boost::urls::detail::segment_iter; + using boost::urls::detail::segment_rule; using boost::urls::detail::segments_compare; using boost::urls::detail::segments_encoded_iter; using boost::urls::detail::segments_encoded_iter_base; @@ -205,6 +231,10 @@ export namespace boost { namespace urls { namespace detail { using boost::urls::detail::to_size_type; using boost::urls::detail::to_sv; using boost::urls::detail::url_impl; + using boost::urls::detail::url_view_shared_impl; + using boost::urls::detail::user_chars; + using boost::urls::detail::userinfo_chars; + using boost::urls::detail::userinfo_rule; using boost::urls::detail::userinfo_rule_t; using boost::urls::detail::vformat; using boost::urls::detail::vformat_to; diff --git a/generated/meta/api-surface.json b/generated/meta/api-surface.json index f5465018..f11357fe 100644 --- a/generated/meta/api-surface.json +++ b/generated/meta/api-surface.json @@ -25,7 +25,7 @@ "type_traits", "utility" ], - "exported": 727, + "exported": 711, "gmf": [ "boost/accumulators/statistics.hpp", "boost/accumulators/statistics/p_square_cumulative_distribution.hpp", @@ -293,7 +293,7 @@ "assert", "core" ], - "exported": 61, + "exported": 65, "gmf": [ "boost/charconv.hpp" ] @@ -645,7 +645,7 @@ }, "decimal": { "deps": [], - "exported": 914, + "exported": 930, "gmf": [ "boost/decimal.hpp", "boost/decimal/fmt_format.hpp" @@ -1137,7 +1137,7 @@ "mp11", "serialization" ], - "exported": 382, + "exported": 386, "gmf": [ "boost/histogram.hpp", "boost/histogram/ostream.hpp", @@ -1372,7 +1372,7 @@ "system", "variant2" ], - "exported": 308, + "exported": 310, "gmf": [ "boost/json/debug_printers.hpp", "boost/json.hpp" @@ -1472,7 +1472,7 @@ "lexical_cast", "random" ], - "exported": 2862, + "exported": 2875, "gmf": [ "boost/math/ccmath/ccmath.hpp", "boost/math/common_factor.hpp", @@ -1557,7 +1557,7 @@ "deps": [ "config" ], - "exported": 355, + "exported": 356, "gmf": [ "boost/move/algo/adaptive_merge.hpp", "boost/move/algo/adaptive_sort.hpp", @@ -2294,7 +2294,7 @@ "range", "type_traits" ], - "exported": 162, + "exported": 163, "gmf": [ "boost/sort/block_indirect_sort/blk_detail/constants.hpp", "boost/sort/common/deque_cnc.hpp", @@ -2370,7 +2370,7 @@ "variant2", "winapi" ], - "exported": 198, + "exported": 199, "gmf": [ "boost/system.hpp", "boost/system/is_error_code_enum.hpp", @@ -2690,7 +2690,7 @@ "type_traits", "variant2" ], - "exported": 337, + "exported": 367, "gmf": [ "boost/url.hpp" ] diff --git a/mcpp.toml b/mcpp.toml index eec42184..17d74cc6 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -690,7 +690,7 @@ sources = [ # System libraries the Windows TUs need, mirroring upstream's WIN32 link set # (cobalt/process sockets and process info, log's object_name, atomic's # WaitOnAddress). Native MSVC passes *.lib in [target.'cfg(compiler = "msvc")'.build]. -[target.'cfg(os = "windows", not(compiler = "msvc"))'.build] +[target.'cfg(os = "windows", compiler = "llvm")'.build] ldflags = ["-lws2_32", "-lntdll", "-lshell32", "-ladvapi32", "-lsecur32", "-luser32", "-lsynchronization"] [target.unix.build] diff --git a/patches/accumulators.patch b/patches/accumulators.patch index b3facba0..67707fd6 100644 --- a/patches/accumulators.patch +++ b/patches/accumulators.patch @@ -611,33 +611,64 @@ index 61904f30..41e1c942 100644 BOOST_ACCUMULATORS_IGNORE_GLOBAL(tail_mean) } diff --git a/upstream/boost/boost/accumulators/numeric/functional.hpp b/upstream/boost/boost/accumulators/numeric/functional.hpp -index 858decc1..346a6e55 100644 +index 858decc1..3c2e81d4 100644 --- a/upstream/boost/boost/accumulators/numeric/functional.hpp +++ b/upstream/boost/boost/accumulators/numeric/functional.hpp -@@ -437,26 +437,23 @@ namespace boost { namespace numeric +@@ -83,6 +83,17 @@ namespace boost { namespace numeric + + // TODO: handle complex weight, valarray, MTL vectors + ++#if defined(BOOST_MSVC) ++#define BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE(Name) \ ++ inline op::Name const &Name = boost::detail::pod_singleton::instance; ++#else ++#define BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE(Name) \ ++ namespace \ ++ { \ ++ op::Name const &Name = boost::detail::pod_singleton::instance; \ ++ } ++#endif ++ + /// INTERNAL ONLY + /// + #define BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(Name, Op) \ +@@ -118,10 +129,7 @@ namespace boost { namespace numeric + : boost::detail::function1 > > \ + {}; \ + } \ +- namespace \ +- { \ +- op::Name const &Name = boost::detail::pod_singleton::instance; \ +- } \ ++ BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE(Name) \ + /**/ + + /// INTERNAL ONLY +@@ -159,10 +167,7 @@ namespace boost { namespace numeric + > \ + {}; \ + } \ +- namespace \ +- { \ +- op::Name const &Name = boost::detail::pod_singleton::instance; \ +- } \ ++ BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE(Name) \ + BOOST_ACCUMULATORS_IGNORE_GLOBAL(Name) \ + /**/ + +@@ -210,6 +215,7 @@ namespace boost { namespace numeric + #undef BOOST_NUMERIC_FUNCTIONAL_LEFT + #undef BOOST_NUMERIC_FUNCTIONAL_DEDUCED + #undef BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP ++#undef BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE + #undef BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP + + namespace functional +@@ -437,6 +443,25 @@ namespace boost { namespace numeric {}; } -- namespace -- { -- op::min_assign const &min_assign = boost::detail::pod_singleton::instance; -- op::max_assign const &max_assign = boost::detail::pod_singleton::instance; -- op::fdiv const &fdiv = boost::detail::pod_singleton::instance; -- op::fdiv const &average = boost::detail::pod_singleton::instance; ///< INTERNAL ONLY -- op::as_min const &as_min = boost::detail::pod_singleton::instance; -- op::as_max const &as_max = boost::detail::pod_singleton::instance; -- op::as_zero const &as_zero = boost::detail::pod_singleton::instance; -- op::as_one const &as_one = boost::detail::pod_singleton::instance; -- -- BOOST_ACCUMULATORS_IGNORE_GLOBAL(min_assign) -- BOOST_ACCUMULATORS_IGNORE_GLOBAL(max_assign) -- BOOST_ACCUMULATORS_IGNORE_GLOBAL(fdiv) -- BOOST_ACCUMULATORS_IGNORE_GLOBAL(average) -- BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_min) -- BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_max) -- BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) -- BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) -- } ++#if defined(BOOST_MSVC) + inline op::min_assign const &min_assign = boost::detail::pod_singleton::instance; + inline op::max_assign const &max_assign = boost::detail::pod_singleton::instance; + inline op::fdiv const &fdiv = boost::detail::pod_singleton::instance; @@ -655,27 +686,77 @@ index 858decc1..346a6e55 100644 + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_max) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) ++#else + namespace + { + op::min_assign const &min_assign = boost::detail::pod_singleton::instance; +@@ -457,6 +482,7 @@ namespace boost { namespace numeric + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) + } ++#endif /////////////////////////////////////////////////////////////////////////////// // promote diff --git a/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp b/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp -index 501f654b..fdb01a7b 100644 +index 501f654b..e366addc 100644 --- a/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp +++ b/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp -@@ -182,16 +182,13 @@ namespace boost { namespace numeric - struct as_one; +@@ -59,6 +59,17 @@ namespace boost { namespace numeric + struct are_integral; } -- namespace -- { -- extern op::min_assign const &min_assign; -- extern op::max_assign const &max_assign; -- extern op::fdiv const &fdiv; -- extern op::as_min const &as_min; -- extern op::as_max const &as_max; -- extern op::as_zero const &as_zero; -- extern op::as_one const &as_one; ++#if defined(BOOST_MSVC) ++#define BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE(Name) \ ++ extern op::Name const &Name; ++#else ++#define BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE(Name) \ ++ namespace \ ++ { \ ++ extern op::Name const &Name; \ ++ } ++#endif ++ + /// INTERNAL ONLY + /// + #define BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(Name, Op) \ +@@ -73,10 +84,7 @@ namespace boost { namespace numeric + { \ + struct Name; \ + } \ +- namespace \ +- { \ +- extern op::Name const &Name; \ +- } ++ BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE(Name) + + /// INTERNAL ONLY + /// +@@ -99,10 +107,7 @@ namespace boost { namespace numeric + { \ + struct Name; \ + } \ +- namespace \ +- { \ +- extern op::Name const &Name; \ - } ++ BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE(Name) + + BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(plus) + BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(minus) +@@ -128,6 +133,7 @@ namespace boost { namespace numeric + BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(complement, ~) + BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(logical_not, !) + ++#undef BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE + #undef BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP + #undef BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP + +@@ -182,6 +188,15 @@ namespace boost { namespace numeric + struct as_one; + } + ++#if defined(BOOST_MSVC) + extern op::min_assign const &min_assign; + extern op::max_assign const &max_assign; + extern op::fdiv const &fdiv; @@ -683,6 +764,15 @@ index 501f654b..fdb01a7b 100644 + extern op::as_max const &as_max; + extern op::as_zero const &as_zero; + extern op::as_one const &as_one; ++#else + namespace + { + extern op::min_assign const &min_assign; +@@ -192,6 +207,7 @@ namespace boost { namespace numeric + extern op::as_zero const &as_zero; + extern op::as_one const &as_one; + } ++#endif template typename lazy_disable_if, mpl::if_, To &, To> >::type diff --git a/patches/asio.patch b/patches/asio.patch index 36ada4ec..6e40f932 100644 --- a/patches/asio.patch +++ b/patches/asio.patch @@ -159,3 +159,236 @@ index 61a9c242..2cdd3147 100644 private: friend struct BOOST_ASIO_VERSIONED_NAME(query_fn)::impl; friend struct boost::asio::execution::detail::mapping_t<0>; +diff --git a/upstream/boost/boost/asio/execution/allocator.hpp b/upstream/boost/boost/asio/execution/allocator.hpp +index 8cacb0a8..6acb193c 100644 +--- a/upstream/boost/boost/asio/execution/allocator.hpp ++++ b/upstream/boost/boost/asio/execution/allocator.hpp +@@ -87,7 +87,7 @@ struct allocator_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +@@ -170,7 +170,7 @@ struct allocator_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/execution/blocking.hpp b/upstream/boost/boost/asio/execution/blocking.hpp +index e1ee4872..a5199d3d 100644 +--- a/upstream/boost/boost/asio/execution/blocking.hpp ++++ b/upstream/boost/boost/asio/execution/blocking.hpp +@@ -236,7 +236,7 @@ struct blocking_t + template + struct proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +@@ -258,7 +258,7 @@ struct blocking_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/execution/blocking_adaptation.hpp b/upstream/boost/boost/asio/execution/blocking_adaptation.hpp +index f15a8fc4..e65536be 100644 +--- a/upstream/boost/boost/asio/execution/blocking_adaptation.hpp ++++ b/upstream/boost/boost/asio/execution/blocking_adaptation.hpp +@@ -186,7 +186,7 @@ struct blocking_adaptation_t + template + struct proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +@@ -208,7 +208,7 @@ struct blocking_adaptation_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/execution/context.hpp b/upstream/boost/boost/asio/execution/context.hpp +index e16f903f..82271642 100644 +--- a/upstream/boost/boost/asio/execution/context.hpp ++++ b/upstream/boost/boost/asio/execution/context.hpp +@@ -86,7 +86,7 @@ struct context_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/execution/inline_exception_handling.hpp b/upstream/boost/boost/asio/execution/inline_exception_handling.hpp +index 776444e1..ca94aa2f 100644 +--- a/upstream/boost/boost/asio/execution/inline_exception_handling.hpp ++++ b/upstream/boost/boost/asio/execution/inline_exception_handling.hpp +@@ -234,7 +234,7 @@ struct inline_exception_handling_t + template + struct proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +@@ -256,7 +256,7 @@ struct inline_exception_handling_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/execution/mapping.hpp b/upstream/boost/boost/asio/execution/mapping.hpp +index af086bce..a940f3a9 100644 +--- a/upstream/boost/boost/asio/execution/mapping.hpp ++++ b/upstream/boost/boost/asio/execution/mapping.hpp +@@ -220,7 +220,7 @@ struct mapping_t + template + struct proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +@@ -242,7 +242,7 @@ struct mapping_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/execution/occupancy.hpp b/upstream/boost/boost/asio/execution/occupancy.hpp +index 011d0cbc..dc1cc859 100644 +--- a/upstream/boost/boost/asio/execution/occupancy.hpp ++++ b/upstream/boost/boost/asio/execution/occupancy.hpp +@@ -79,7 +79,7 @@ struct occupancy_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/execution/outstanding_work.hpp b/upstream/boost/boost/asio/execution/outstanding_work.hpp +index c6343dd1..a4331d4f 100644 +--- a/upstream/boost/boost/asio/execution/outstanding_work.hpp ++++ b/upstream/boost/boost/asio/execution/outstanding_work.hpp +@@ -181,7 +181,7 @@ struct outstanding_work_t + template + struct proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +@@ -203,7 +203,7 @@ struct outstanding_work_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/execution/relationship.hpp b/upstream/boost/boost/asio/execution/relationship.hpp +index 9e7bd844..c6ea9730 100644 +--- a/upstream/boost/boost/asio/execution/relationship.hpp ++++ b/upstream/boost/boost/asio/execution/relationship.hpp +@@ -181,7 +181,7 @@ struct relationship_t + template + struct proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +@@ -203,7 +203,7 @@ struct relationship_t + template + struct static_proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/prefer.hpp b/upstream/boost/boost/asio/prefer.hpp +index 6b77840f..9484e9f6 100644 +--- a/upstream/boost/boost/asio/prefer.hpp ++++ b/upstream/boost/boost/asio/prefer.hpp +@@ -395,7 +395,8 @@ struct impl + struct proxy + { + #if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) \ +- && defined(BOOST_ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) ++ && defined(BOOST_ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) \ ++ && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/query.hpp b/upstream/boost/boost/asio/query.hpp +index bc54cc37..f3271a91 100644 +--- a/upstream/boost/boost/asio/query.hpp ++++ b/upstream/boost/boost/asio/query.hpp +@@ -194,7 +194,7 @@ struct impl + template + struct proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/require.hpp b/upstream/boost/boost/asio/require.hpp +index a320fe6a..704a57b0 100644 +--- a/upstream/boost/boost/asio/require.hpp ++++ b/upstream/boost/boost/asio/require.hpp +@@ -285,7 +285,7 @@ struct impl + template + struct proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template +diff --git a/upstream/boost/boost/asio/require_concept.hpp b/upstream/boost/boost/asio/require_concept.hpp +index 5f795f6f..dd4be0cd 100644 +--- a/upstream/boost/boost/asio/require_concept.hpp ++++ b/upstream/boost/boost/asio/require_concept.hpp +@@ -220,7 +220,7 @@ struct impl + template + struct proxy + { +-#if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT) ++#if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) + struct type + { + template diff --git a/patches/charconv.patch b/patches/charconv.patch new file mode 100644 index 00000000..8338bc07 --- /dev/null +++ b/patches/charconv.patch @@ -0,0 +1,44 @@ +diff --git a/upstream/boost/boost/charconv/detail/from_chars_integer_impl.hpp b/upstream/boost/boost/charconv/detail/from_chars_integer_impl.hpp +index 6680c06a..f11ab779 100644 +--- a/upstream/boost/boost/charconv/detail/from_chars_integer_impl.hpp ++++ b/upstream/boost/boost/charconv/detail/from_chars_integer_impl.hpp +@@ -24,7 +24,7 @@ namespace boost { namespace charconv { namespace detail { + + #if !(defined(BOOST_CHARCONV_ENABLE_CUDA) && defined(__CUDACC__)) + +-static constexpr unsigned char uchar_values[] = ++inline constexpr unsigned char uchar_values[] = + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +@@ -44,7 +44,7 @@ static constexpr unsigned char uchar_values[] = + + static_assert(sizeof(uchar_values) == 256, "uchar_values should represent all 256 values of unsigned char"); + +-static constexpr double log_2_table[] = ++inline constexpr double log_2_table[] = + { + 0.0, + 0.0, +diff --git a/upstream/boost/boost/charconv/detail/to_chars_integer_impl.hpp b/upstream/boost/boost/charconv/detail/to_chars_integer_impl.hpp +index 79066d82..8514b60a 100644 +--- a/upstream/boost/boost/charconv/detail/to_chars_integer_impl.hpp ++++ b/upstream/boost/boost/charconv/detail/to_chars_integer_impl.hpp +@@ -29,7 +29,7 @@ + namespace boost { namespace charconv { namespace detail { + + +-static constexpr char radix_table[] = { ++inline constexpr char radix_table[] = { + '0', '0', '0', '1', '0', '2', '0', '3', '0', '4', + '0', '5', '0', '6', '0', '7', '0', '8', '0', '9', + '1', '0', '1', '1', '1', '2', '1', '3', '1', '4', +@@ -54,7 +54,7 @@ static constexpr char radix_table[] = { + + #if !(defined(BOOST_CHARCONV_ENABLE_CUDA) && defined(__CUDACC__)) + +-static constexpr char digit_table[] = { ++inline constexpr char digit_table[] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', + 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', diff --git a/patches/decimal.patch b/patches/decimal.patch new file mode 100644 index 00000000..110f42ff --- /dev/null +++ b/patches/decimal.patch @@ -0,0 +1,39 @@ +diff --git a/upstream/boost/boost/decimal/detail/cmath/impl/sqrt_lookup.hpp b/upstream/boost/boost/decimal/detail/cmath/impl/sqrt_lookup.hpp +index 85d29b3f..5de55f34 100644 +--- a/upstream/boost/boost/decimal/detail/cmath/impl/sqrt_lookup.hpp ++++ b/upstream/boost/boost/decimal/detail/cmath/impl/sqrt_lookup.hpp +@@ -35,7 +35,7 @@ namespace detail { + namespace sqrt_lookup { + + // recip_sqrt_k0s[i] = 10^16 / sqrt(1 + i * 0.1) at left edge of bin +-static constexpr std::uint64_t recip_sqrt_k0s[90] = { ++inline constexpr std::uint64_t recip_sqrt_k0s[90] = { + 10000000000000000ULL, 9534625892455923ULL, 9128709291752768ULL, 8770580193070292ULL, + 8451542547285165ULL, 8164965809277260ULL, 7905694150420948ULL, 7669649888473704ULL, + 7453559924999298ULL, 7254762501100116ULL, 7071067811865475ULL, 6900655593423542ULL, +@@ -62,7 +62,7 @@ static constexpr std::uint64_t recip_sqrt_k0s[90] = { + }; + + // recip_sqrt_k1s[i] = k0[i] - k0[i+1] (slope for linear interpolation) +-static constexpr std::uint64_t recip_sqrt_k1s[90] = { ++inline constexpr std::uint64_t recip_sqrt_k1s[90] = { + 465374107544077ULL, 405916600703155ULL, 358129098682476ULL, 319037645785127ULL, + 286576738007905ULL, 259271658856312ULL, 236044261947244ULL, 216089963474406ULL, + 198797423899182ULL, 183694689234641ULL, 170412218441933ULL, 158656968791122ULL, +diff --git a/upstream/boost/boost/decimal/detail/int128/detail/config.hpp b/upstream/boost/boost/decimal/detail/int128/detail/config.hpp +index 6118b06b..cb07c3eb 100644 +--- a/upstream/boost/boost/decimal/detail/int128/detail/config.hpp ++++ b/upstream/boost/boost/decimal/detail/int128/detail/config.hpp +@@ -246,7 +246,11 @@ using builtin_u128 = std::_Unsigned128; + # define BOOST_DECIMAL_DETAIL_INT128_INLINE_CONSTEXPR inline constexpr + # define BOOST_DECIMAL_DETAIL_INT128_EXPORT export + #else +-# define BOOST_DECIMAL_DETAIL_INT128_INLINE_CONSTEXPR static constexpr ++# if defined(__cplusplus) && __cplusplus >= 201703L ++# define BOOST_DECIMAL_DETAIL_INT128_INLINE_CONSTEXPR inline constexpr ++# else ++# define BOOST_DECIMAL_DETAIL_INT128_INLINE_CONSTEXPR static constexpr ++# endif + # define BOOST_DECIMAL_DETAIL_INT128_EXPORT + #endif + diff --git a/patches/histogram.patch b/patches/histogram.patch new file mode 100644 index 00000000..eb5d6d60 --- /dev/null +++ b/patches/histogram.patch @@ -0,0 +1,19 @@ +diff --git a/upstream/boost/boost/histogram/axis/option.hpp b/upstream/boost/boost/histogram/axis/option.hpp +index e71999b9..9ecf3087 100644 +--- a/upstream/boost/boost/histogram/axis/option.hpp ++++ b/upstream/boost/boost/histogram/axis/option.hpp +@@ -75,10 +75,10 @@ using circular_t = bit<2>; + using growth_t = bit<3>; + + constexpr none_t none{}; ///< Instance of `none_t`. +-constexpr underflow_t underflow{}; ///< Instance of `underflow_t`. +-constexpr overflow_t overflow{}; ///< Instance of `overflow_t`. +-constexpr circular_t circular{}; ///< Instance of `circular_t`. +-constexpr growth_t growth{}; ///< Instance of `growth_t`. ++inline constexpr underflow_t underflow{}; ///< Instance of `underflow_t`. ++inline constexpr overflow_t overflow{}; ///< Instance of `overflow_t`. ++inline constexpr circular_t circular{}; ///< Instance of `circular_t`. ++inline constexpr growth_t growth{}; ///< Instance of `growth_t`. + + } // namespace option + } // namespace axis diff --git a/patches/json.patch b/patches/json.patch index 14acd317..7f459700 100644 --- a/patches/json.patch +++ b/patches/json.patch @@ -20,3 +20,25 @@ index a11cc056..eb0c203b 100644 } // detail } // namespace json +diff --git a/upstream/boost/boost/json/detail/literals.hpp b/upstream/boost/boost/json/detail/literals.hpp +index 215461e7..76f8e5a9 100644 +--- a/upstream/boost/boost/json/detail/literals.hpp ++++ b/upstream/boost/boost/json/detail/literals.hpp +@@ -28,7 +28,7 @@ enum class literals + resume, + }; + +-constexpr char const* literal_strings[] = { ++BOOST_INLINE_CONSTEXPR char const* literal_strings[] = { + "null", + "true", + "false", +@@ -38,7 +38,7 @@ constexpr char const* literal_strings[] = { + "", + }; + +-constexpr std::size_t literal_sizes[] = { ++BOOST_INLINE_CONSTEXPR std::size_t literal_sizes[] = { + 4, + 4, + 5, diff --git a/patches/math.patch b/patches/math.patch index d1bfdb29..4a2f0dee 100644 --- a/patches/math.patch +++ b/patches/math.patch @@ -306,3 +306,82 @@ index c285b479..3cb1fa60 100644 Real yh = f(x + h); Real y0 = f(x); Real diff = yh - y0; +diff --git a/upstream/boost/boost/math/special_functions/detail/lambert_w_lookup_table.ipp b/upstream/boost/boost/math/special_functions/detail/lambert_w_lookup_table.ipp +index 9f1b488e..ff18274d 100644 +--- a/upstream/boost/boost/math/special_functions/detail/lambert_w_lookup_table.ipp ++++ b/upstream/boost/boost/math/special_functions/detail/lambert_w_lookup_table.ipp +@@ -21,21 +21,21 @@ namespace math { + namespace lambert_w_detail { + namespace lambert_w_lookup + { +-static constexpr std::size_t noof_sqrts = 12; +-static constexpr std::size_t noof_halves = 12; +-static constexpr std::size_t noof_w0es = 65; +-static constexpr std::size_t noof_w0zs = 65; +-static constexpr std::size_t noof_wm1es = 64; +-static constexpr std::size_t noof_wm1zs = 64; ++BOOST_INLINE_CONSTEXPR std::size_t noof_sqrts = 12; ++BOOST_INLINE_CONSTEXPR std::size_t noof_halves = 12; ++BOOST_INLINE_CONSTEXPR std::size_t noof_w0es = 65; ++BOOST_INLINE_CONSTEXPR std::size_t noof_w0zs = 65; ++BOOST_INLINE_CONSTEXPR std::size_t noof_wm1es = 64; ++BOOST_INLINE_CONSTEXPR std::size_t noof_wm1zs = 64; + +-static constexpr lookup_t halves[noof_halves] = ++BOOST_INLINE_CONSTEXPR lookup_t halves[noof_halves] = + { // Common to Lambert W0 and W-1 (and exactly representable). + static_cast(0.5L), static_cast(0.25L), static_cast(0.125L), static_cast(0.0625L), + static_cast(0.03125L), static_cast(0.015625L), static_cast(0.0078125L), static_cast(0.00390625L), + static_cast(0.001953125L), static_cast(0.0009765625L), static_cast(0.00048828125L), static_cast(0.000244140625L) + }; // halves, 0.5, 0.25, ... 0.000244140625, common to W0 and W-1. + +-static constexpr lookup_t sqrtw0s[noof_sqrts] = ++BOOST_INLINE_CONSTEXPR lookup_t sqrtw0s[noof_sqrts] = + { // For Lambert W0 only. + static_cast(0.6065306597126334242631173765403218567L), static_cast(0.7788007830714048686684607000907199500L), + static_cast(0.8824969025845954031047175929687018290L), static_cast(0.9394130628134757862473572557999761753L), +@@ -45,7 +45,7 @@ static constexpr lookup_t sqrtw0s[noof_sqrts] = + static_cast(0.9995118379398893653889967919448497792L), static_cast(0.9997558891748972165136242351259789505L) + }; // sqrtw0s + +-static constexpr lookup_t sqrtwm1s[noof_sqrts] = ++BOOST_INLINE_CONSTEXPR lookup_t sqrtwm1s[noof_sqrts] = + { // For Lambert W-1 only. + static_cast(1.648721270700128146848650787814163572L), static_cast(1.284025416687741484073420568062436458L), + static_cast(1.133148453066826316829007227811793873L), static_cast(1.064494458917859429563390594642889673L), +@@ -55,7 +55,7 @@ static constexpr lookup_t sqrtwm1s[noof_sqrts] = + static_cast(1.000488400478694473126173623807163354L), static_cast(1.000244170429747854937005233924135774L) + }; // sqrtwm1s + +-static constexpr lookup_t w0es[noof_w0zs] = ++BOOST_INLINE_CONSTEXPR lookup_t w0es[noof_w0zs] = + { // Fukushima e powers array e[0] = 2.718, 1., e[2] = e^-1 = 0.135, e[3] = e^-2 = 0.133 ... e[64] = 4.3596100000630809736231248158884615452e-28. + static_cast(2.7182818284590452353602874713526624978e+00L), + static_cast(1.0000000000000000000000000000000000000e+00L), static_cast(3.6787944117144232159552377016146086745e-01L), +@@ -93,7 +93,7 @@ static constexpr lookup_t w0es[noof_w0zs] = + + }; // w0es + +-static constexpr lookup_t w0zs[noof_w0zs] = ++BOOST_INLINE_CONSTEXPR lookup_t w0zs[noof_w0zs] = + { // z values for W[0], W[1], W[2] ... W[64] (Fukushima array Fk). + static_cast(0.0000000000000000000000000000000000000e+00L), + static_cast(2.7182818284590452353602874713526624978e+00L), static_cast(1.4778112197861300454460854921150015626e+01L), static_cast(6.0256610769563003222785588963745153691e+01L), static_cast(2.1839260013257695631244104481144351361e+02L), +@@ -115,7 +115,7 @@ static constexpr lookup_t w0zs[noof_w0zs] = + + }; // w0zs + +-static constexpr lookup_t wm1es[noof_wm1es] = ++BOOST_INLINE_CONSTEXPR lookup_t wm1es[noof_wm1es] = + { // Fukushima e array e[0] = e^1 = 2.718, e[1] = e^2 = 7.39 ... e[64] = 4.60718e+28. + static_cast(2.7182818284590452353602874713526624978e+00L), + static_cast(7.3890560989306502272304274605750078132e+00L), static_cast(2.0085536923187667740928529654581717897e+01L), static_cast(5.4598150033144239078110261202860878403e+01L), static_cast(1.4841315910257660342111558004055227962e+02L), +@@ -136,7 +136,7 @@ static constexpr lookup_t wm1es[noof_wm1es] = + static_cast(8.4383566687414544890733294803731179601e+26L), static_cast(2.2937831594696098790993528402686136005e+27L), static_cast(6.2351490808116168829092387089284697448e+27L) + }; // wm1es + +-static constexpr lookup_t wm1zs[noof_wm1zs] = ++BOOST_INLINE_CONSTEXPR lookup_t wm1zs[noof_wm1zs] = + { // Fukushima G array of z values for integral K, (Fukushima Gk) g[0] (k = -1) = 1 ... g[64] = -1.0264389699511303e-26. + static_cast(-3.6787944117144232159552377016146086745e-01L), + static_cast(-2.7067056647322538378799898994496880682e-01L), static_cast(-1.4936120510359182893802724695018532990e-01L), static_cast(-7.3262555554936721174872085092964968848e-02L), static_cast(-3.3689734995427335483180242115742121244e-02L), diff --git a/patches/move.patch b/patches/move.patch new file mode 100644 index 00000000..c796c091 --- /dev/null +++ b/patches/move.patch @@ -0,0 +1,13 @@ +diff --git a/upstream/boost/boost/move/algo/detail/adaptive_sort_merge.hpp b/upstream/boost/boost/move/algo/detail/adaptive_sort_merge.hpp +index 2b45407d..dd3fdc61 100644 +--- a/upstream/boost/boost/move/algo/detail/adaptive_sort_merge.hpp ++++ b/upstream/boost/boost/move/algo/detail/adaptive_sort_merge.hpp +@@ -102,7 +102,7 @@ namespace boost { + namespace movelib { + namespace detail_adaptive { + +-static const std::size_t AdaptiveSortInsertionSortThreshold = 16; ++BOOST_INLINE_CONSTEXPR std::size_t AdaptiveSortInsertionSortThreshold = 16; + //static const std::size_t AdaptiveSortInsertionSortThreshold = 4; + BOOST_MOVE_STATIC_ASSERT((AdaptiveSortInsertionSortThreshold&(AdaptiveSortInsertionSortThreshold-1)) == 0); + diff --git a/patches/sort.patch b/patches/sort.patch index 17384994..086cabf9 100644 --- a/patches/sort.patch +++ b/patches/sort.patch @@ -29,3 +29,16 @@ index 3711cce5..94fcc18a 100644 { uint32_t Pos = (num & 0xffffffff00000000ULL) ? 32 : 0; if ((num >> Pos) & 0xffff0000ULL) Pos += 16; +diff --git a/upstream/boost/boost/sort/common/util/algorithm.hpp b/upstream/boost/boost/sort/common/util/algorithm.hpp +index 94fcc18a..ec981739 100644 +--- a/upstream/boost/boost/sort/common/util/algorithm.hpp ++++ b/upstream/boost/boost/sort/common/util/algorithm.hpp +@@ -85,7 +85,7 @@ namespace util + // + // this array represent the number of bits needed for to represent the + // first 256 numbers +-static constexpr const uint32_t tmsb[256] = ++inline constexpr const uint32_t tmsb[256] = + { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, diff --git a/patches/system.patch b/patches/system.patch index de1da264..d0f06374 100644 --- a/patches/system.patch +++ b/patches/system.patch @@ -97,9 +97,9 @@ index a395c81..9b418e4 100644 std::size_t hash_value( error_code const & ec ); +// boost-module (M5 B'): 原为 error_code::location() 函数内 static — gcc 模块管线在消费者 -+// TU 以强符号发射函数内 static (非 COMDAT), 与库 TU 多重定义; 改命名空间作用域内部链接 -+// constexpr (空 source_location, 每 TU 独立持有, 语义等价)。 -+static constexpr source_location default_location = source_location(); ++// TU 以强符号发射函数内 static (非 COMDAT), 与库 TU 多重定义; 改命名空间作用域 ++// BOOST_INLINE_CONSTEXPR (COMDAT, 跨 MSVC/GCC/Clang 模块均可链接)。 ++BOOST_INLINE_CONSTEXPR source_location default_location = source_location(); + class error_code { diff --git a/patches/url.patch b/patches/url.patch index e54d826e..638342ff 100644 --- a/patches/url.patch +++ b/patches/url.patch @@ -314,15 +314,393 @@ index 27973a0b..eaccf866 100644 virtual ~url_base() noexcept = default; url_base() noexcept = default; url_base(detail::url_impl const&) noexcept; -diff --git a/upstream/boost/boost/url/url_view_base.hpp b/upstream/boost/boost/url/url_view_base.hpp -index 7d59598c..1b81eb42 100644 ---- a/upstream/boost/boost/url/url_view_base.hpp -+++ b/upstream/boost/boost/url/url_view_base.hpp -@@ -112,6 +112,7 @@ class BOOST_SYMBOL_VISIBLE url_view_base +diff --git a/upstream/boost/boost/url/detail/encode.hpp b/upstream/boost/boost/url/detail/encode.hpp +index 9c6f785a..c16890a7 100644 +--- a/upstream/boost/boost/url/detail/encode.hpp ++++ b/upstream/boost/boost/url/detail/encode.hpp +@@ -22,7 +22,7 @@ namespace urls { + namespace detail { + + constexpr +-char const* const hexdigs[] = { ++BOOST_INLINE_CONSTEXPR char const* const hexdigs[] = { + "0123456789ABCDEF", + "0123456789abcdef" }; + +diff --git a/upstream/boost/boost/url/detail/replacement_field_rule.hpp b/upstream/boost/boost/url/detail/replacement_field_rule.hpp +index a3ce50c2..35414c24 100644 +--- a/upstream/boost/boost/url/detail/replacement_field_rule.hpp ++++ b/upstream/boost/boost/url/detail/replacement_field_rule.hpp +@@ -31,7 +31,7 @@ struct replacement_field_rule_t + char const* end) const noexcept; + }; + +-constexpr replacement_field_rule_t replacement_field_rule{}; ++BOOST_INLINE_CONSTEXPR replacement_field_rule_t replacement_field_rule{}; + + // identifier ::= id_start id_continue* + // id_start ::= "a"..."z" | "A"..."Z" | "_" +@@ -47,12 +47,12 @@ struct identifier_rule_t + char const* end) const noexcept; + }; + +-constexpr identifier_rule_t identifier_rule{}; ++BOOST_INLINE_CONSTEXPR identifier_rule_t identifier_rule{}; + + // arg_id ::= integer | identifier + // integer ::= digit+ + // digit ::= "0"..."9" +-static constexpr auto arg_id_rule = ++BOOST_INLINE_CONSTEXPR auto arg_id_rule = + grammar::variant_rule( + identifier_rule, + grammar::unsigned_rule{}); +@@ -67,7 +67,7 @@ struct format_spec_rule_t + char const* end) const noexcept; + }; + +-constexpr format_spec_rule_t format_spec_rule{}; ++BOOST_INLINE_CONSTEXPR format_spec_rule_t format_spec_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/detail/url_impl.hpp b/upstream/boost/boost/url/detail/url_impl.hpp +index 7da4eebb..c03463b3 100644 +--- a/upstream/boost/boost/url/detail/url_impl.hpp ++++ b/upstream/boost/boost/url/detail/url_impl.hpp +@@ -28,7 +28,7 @@ class authority_view; + + namespace detail { + +-constexpr char const* const empty_c_str_ = ""; ++BOOST_INLINE_CONSTEXPR char const* const empty_c_str_ = ""; + + // This is the private 'guts' of a + // url_view, exposed so different parts +diff --git a/upstream/boost/boost/url/impl/url_view.hpp b/upstream/boost/boost/url/impl/url_view.hpp +index 881fcec3..21481e16 100644 +--- a/upstream/boost/boost/url/impl/url_view.hpp ++++ b/upstream/boost/boost/url/impl/url_view.hpp +@@ -39,15 +39,16 @@ url_view(core::string_view s) + // + //------------------------------------------------ + +-struct url_view_base::shared_impl ++namespace detail { ++struct url_view_shared_impl + : url_view + { + virtual +- ~shared_impl() ++ ~url_view_shared_impl() { } +- shared_impl( ++ url_view_shared_impl( + url_view const& u) noexcept + : url_view(u) + { +@@ -55,13 +56,14 @@ struct url_view_base::shared_impl + char const*>(this + 1); + } + }; ++} // detail + + inline + std::shared_ptr + url_view_base:: + persist() const + { +- using T = shared_impl; ++ using T = detail::url_view_shared_impl; + using Alloc = std::allocator; + Alloc a; + auto p = std::allocate_shared( +diff --git a/upstream/boost/boost/url/rfc/detail/charsets.hpp b/upstream/boost/boost/url/rfc/detail/charsets.hpp +index f3c82f57..b7d7017b 100644 +--- a/upstream/boost/boost/url/rfc/detail/charsets.hpp ++++ b/upstream/boost/boost/url/rfc/detail/charsets.hpp +@@ -28,73 +28,73 @@ struct empty_chars_t + } + }; + +-constexpr ++BOOST_INLINE_CONSTEXPR + empty_chars_t + empty_chars{}; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + user_chars = + unreserved_chars + sub_delim_chars; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + password_chars = + unreserved_chars + sub_delim_chars + ':'; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + userinfo_chars = + password_chars; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + host_chars = + unreserved_chars + sub_delim_chars; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + reg_name_chars = + unreserved_chars + '-' + '.'; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + segment_chars = + pchars; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + path_chars = + segment_chars + '/'; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + query_chars = + pchars + '/' + '?' + '[' + ']'; + +-constexpr ++BOOST_INLINE_CONSTEXPR + grammar::lut_chars + query_ignore_chars = + "&=+"; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + param_key_chars = pchars + + '/' + '?' + '[' + ']' + - '&' - '='; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + param_value_chars = pchars + + '/' + '?' + - '&'; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + fragment_chars = + pchars + '/' + '?' + '#'; + +-constexpr ++BOOST_INLINE_CONSTEXPR + auto + nocolon_pchars = + pchars - ':'; +diff --git a/upstream/boost/boost/url/rfc/detail/fragment_part_rule.hpp b/upstream/boost/boost/url/rfc/detail/fragment_part_rule.hpp +index b6010631..e2687465 100644 +--- a/upstream/boost/boost/url/rfc/detail/fragment_part_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/fragment_part_rule.hpp +@@ -62,7 +62,7 @@ struct fragment_part_rule_t + return t; + } + }; +-constexpr fragment_part_rule_t fragment_part_rule{}; ++BOOST_INLINE_CONSTEXPR fragment_part_rule_t fragment_part_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/h16_rule.hpp b/upstream/boost/boost/url/rfc/detail/h16_rule.hpp +index 8649afe4..fbf1f5a6 100644 +--- a/upstream/boost/boost/url/rfc/detail/h16_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/h16_rule.hpp +@@ -51,7 +51,7 @@ struct h16_rule_t + system::result; + }; + +-constexpr h16_rule_t h16_rule{}; ++BOOST_INLINE_CONSTEXPR h16_rule_t h16_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/hier_part_rule.hpp b/upstream/boost/boost/url/rfc/detail/hier_part_rule.hpp +index d3c110c8..9500caf6 100644 +--- a/upstream/boost/boost/url/rfc/detail/hier_part_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/hier_part_rule.hpp +@@ -53,7 +53,7 @@ struct hier_part_rule_t + system::result; + }; + +-constexpr hier_part_rule_t hier_part_rule{}; ++BOOST_INLINE_CONSTEXPR hier_part_rule_t hier_part_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/host_rule.hpp b/upstream/boost/boost/url/rfc/detail/host_rule.hpp +index 2a6c09e1..46a7b973 100644 +--- a/upstream/boost/boost/url/rfc/detail/host_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/host_rule.hpp +@@ -58,7 +58,7 @@ struct host_rule_t + system::result; + }; + +-constexpr host_rule_t host_rule{}; ++BOOST_INLINE_CONSTEXPR host_rule_t host_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/ip_literal_rule.hpp b/upstream/boost/boost/url/rfc/detail/ip_literal_rule.hpp +index de590c03..5c437b67 100644 +--- a/upstream/boost/boost/url/rfc/detail/ip_literal_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/ip_literal_rule.hpp +@@ -52,7 +52,7 @@ struct ip_literal_rule_t + system::result; + }; + +-constexpr ip_literal_rule_t ip_literal_rule{}; ++BOOST_INLINE_CONSTEXPR ip_literal_rule_t ip_literal_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/ipv6_addrz_rule.hpp b/upstream/boost/boost/url/rfc/detail/ipv6_addrz_rule.hpp +index 601786df..99b637c1 100644 +--- a/upstream/boost/boost/url/rfc/detail/ipv6_addrz_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/ipv6_addrz_rule.hpp +@@ -48,7 +48,7 @@ struct ipv6_addrz_rule_t + system::result; + }; + +-constexpr ipv6_addrz_rule_t ipv6_addrz_rule{}; ++BOOST_INLINE_CONSTEXPR ipv6_addrz_rule_t ipv6_addrz_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/ipvfuture_rule.hpp b/upstream/boost/boost/url/rfc/detail/ipvfuture_rule.hpp +index 12fc1040..afa1ec10 100644 +--- a/upstream/boost/boost/url/rfc/detail/ipvfuture_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/ipvfuture_rule.hpp +@@ -47,7 +47,7 @@ struct ipvfuture_rule_t + system::result; + }; + +-constexpr ipvfuture_rule_t ipvfuture_rule{}; ++BOOST_INLINE_CONSTEXPR ipvfuture_rule_t ipvfuture_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/path_rules.hpp b/upstream/boost/boost/url/rfc/detail/path_rules.hpp +index 3f47dfc4..8dcfab9f 100644 +--- a/upstream/boost/boost/url/rfc/detail/path_rules.hpp ++++ b/upstream/boost/boost/url/rfc/detail/path_rules.hpp +@@ -34,7 +34,7 @@ namespace detail { + @see + @ref grammar::parse. + */ +-constexpr auto segment_rule = ++BOOST_INLINE_CONSTEXPR auto segment_rule = + pct_encoded_rule(pchars); + + } // detail +diff --git a/upstream/boost/boost/url/rfc/detail/port_rule.hpp b/upstream/boost/boost/url/rfc/detail/port_rule.hpp +index 5893d699..984a33aa 100644 +--- a/upstream/boost/boost/url/rfc/detail/port_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/port_rule.hpp +@@ -87,7 +87,7 @@ struct port_part_rule_t + system::result; + }; + +-constexpr port_part_rule_t port_part_rule{}; ++BOOST_INLINE_CONSTEXPR port_part_rule_t port_part_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/query_part_rule.hpp b/upstream/boost/boost/url/rfc/detail/query_part_rule.hpp +index c09e248e..e4308b7d 100644 +--- a/upstream/boost/boost/url/rfc/detail/query_part_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/query_part_rule.hpp +@@ -88,7 +88,7 @@ struct query_part_rule_t + } + }; + +-constexpr query_part_rule_t query_part_rule{}; ++BOOST_INLINE_CONSTEXPR query_part_rule_t query_part_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/reg_name_rule.hpp b/upstream/boost/boost/url/rfc/detail/reg_name_rule.hpp +index 3fa2c80c..fac0130b 100644 +--- a/upstream/boost/boost/url/rfc/detail/reg_name_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/reg_name_rule.hpp +@@ -46,7 +46,7 @@ namespace detail { + @li Errata ID: 4942 + */ +-constexpr auto reg_name_rule = ++BOOST_INLINE_CONSTEXPR auto reg_name_rule = + pct_encoded_rule(unreserved_chars + sub_delim_chars); + + } // detail +diff --git a/upstream/boost/boost/url/rfc/detail/relative_part_rule.hpp b/upstream/boost/boost/url/rfc/detail/relative_part_rule.hpp +index 9bbb3ca4..d7c4c585 100644 +--- a/upstream/boost/boost/url/rfc/detail/relative_part_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/relative_part_rule.hpp +@@ -59,7 +59,7 @@ struct relative_part_rule_t + system::result; + }; + +-constexpr relative_part_rule_t relative_part_rule{}; ++BOOST_INLINE_CONSTEXPR relative_part_rule_t relative_part_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/rfc/detail/userinfo_rule.hpp b/upstream/boost/boost/url/rfc/detail/userinfo_rule.hpp +index 525d8710..6d3c8a12 100644 +--- a/upstream/boost/boost/url/rfc/detail/userinfo_rule.hpp ++++ b/upstream/boost/boost/url/rfc/detail/userinfo_rule.hpp +@@ -51,7 +51,7 @@ struct userinfo_rule_t + system::result; + }; + +-constexpr userinfo_rule_t userinfo_rule{}; ++BOOST_INLINE_CONSTEXPR userinfo_rule_t userinfo_rule{}; + + } // detail + } // urls +diff --git a/upstream/boost/boost/url/url_view_base.hpp b/upstream/boost/boost/url/url_view_base.hpp +index 7d59598c..2164d19f 100644 +--- a/upstream/boost/boost/url/url_view_base.hpp ++++ b/upstream/boost/boost/url/url_view_base.hpp +@@ -65,9 +65,11 @@ struct pattern; + class BOOST_SYMBOL_VISIBLE url_view_base + : private detail::parts_base + { +protected: - ~url_view_base() = default; + detail::url_impl impl_; + detail::url_impl const* external_impl_; + ++private: + friend class url; + friend class url_base; + friend class url_view; +@@ -86,8 +88,7 @@ class BOOST_SYMBOL_VISIBLE url_view_base + friend class segments_view; + friend struct detail::pattern; +- struct shared_impl; +- ++protected: + // Returns reference to the active implementation. + // Uses external_impl_ if set, otherwise local impl_. BOOST_URL_CXX14_CONSTEXPR diff --git a/tests/describe/include_examples.cpp b/tests/describe/include_examples.cpp index 14338942..e2fc2c33 100644 --- a/tests/describe/include_examples.cpp +++ b/tests/describe/include_examples.cpp @@ -388,8 +388,12 @@ TEST_CASE("example: pm_to_string") { &ex_pm_to_string::X::f [int() const] &ex_pm_to_string::Y::g [int() const] &ex_pm_to_string::Z::(unknown) [void()] -&ex_pm_to_string::pair::second [float] -)ex")); +)ex" +#if !defined(_MSC_VER) || defined(__clang__) +R"ex(&ex_pm_to_string::pair::second [float] +)ex" +#endif + )); } } // namespace ex_pm_to_string diff --git a/tests/test/included/example/test_case_template_example.cpp b/tests/test/included/example/test_case_template_example.cpp index 12060726..2c084543 100644 --- a/tests/test/included/example/test_case_template_example.cpp +++ b/tests/test/included/example/test_case_template_example.cpp @@ -75,6 +75,9 @@ inline std::string normalize(std::string s) { // MSVC's type names carry the class-key ("class std::runtime_error") static const std::regex key(R"((: |error: )(?:class|struct) )"); s = std::regex_replace(s, key, "$1"); + // MSVC's typeid spells boost::mpl::integral_c with the outer namespace rather than mpl_ + static const std::regex mpl_ns(R"(boost__mpl__integral_c)"); + s = std::regex_replace(s, mpl_ns, "mpl___integral_c"); // trailing blanks and blank lines are not part of what is compared static const std::regex trailing(R"([ \t]+\n)"); s = std::regex_replace(s, trailing, "\n"); diff --git a/tools/apply_patches.py b/tools/apply_patches.py index d7f4feeb..7b19a9dc 100644 --- a/tools/apply_patches.py +++ b/tools/apply_patches.py @@ -28,9 +28,9 @@ # One entry per patches/.patch; see patches/README.md for each reason. PATCHES = [ - "accumulators", "algorithm", "asio", "beast", "bimap", "bloom", "cobalt", "config_platform", - "config_cstdlib", "config_user", "container", "convert", "hof", "interprocess", "io", "json", "lambda", "math", - "mqtt5", "multi_array", "openmethod", "parameter", "range_adaptors", "numeric", "regex", + "accumulators", "algorithm", "asio", "beast", "bimap", "bloom", "charconv", "cobalt", "config_platform", + "config_cstdlib", "config_user", "container", "convert", "decimal", "histogram", "hof", "interprocess", "io", "json", "lambda", "math", + "move", "mqtt5", "multi_array", "openmethod", "parameter", "range_adaptors", "numeric", "regex", "safe_numerics", "serialization", "sort", "system", "test", "thread", "type_erasure", "ublas", "units", "unordered", "url", "variant", ] diff --git a/upstream/boost/boost/accumulators/numeric/functional.hpp b/upstream/boost/boost/accumulators/numeric/functional.hpp index 346a6e55..3c2e81d4 100644 --- a/upstream/boost/boost/accumulators/numeric/functional.hpp +++ b/upstream/boost/boost/accumulators/numeric/functional.hpp @@ -83,6 +83,17 @@ namespace boost { namespace numeric // TODO: handle complex weight, valarray, MTL vectors +#if defined(BOOST_MSVC) +#define BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE(Name) \ + inline op::Name const &Name = boost::detail::pod_singleton::instance; +#else +#define BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE(Name) \ + namespace \ + { \ + op::Name const &Name = boost::detail::pod_singleton::instance; \ + } +#endif + /// INTERNAL ONLY /// #define BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(Name, Op) \ @@ -118,10 +129,7 @@ namespace boost { namespace numeric : boost::detail::function1 > > \ {}; \ } \ - namespace \ - { \ - op::Name const &Name = boost::detail::pod_singleton::instance; \ - } \ + BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE(Name) \ /**/ /// INTERNAL ONLY @@ -159,10 +167,7 @@ namespace boost { namespace numeric > \ {}; \ } \ - namespace \ - { \ - op::Name const &Name = boost::detail::pod_singleton::instance; \ - } \ + BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE(Name) \ BOOST_ACCUMULATORS_IGNORE_GLOBAL(Name) \ /**/ @@ -210,6 +215,7 @@ namespace boost { namespace numeric #undef BOOST_NUMERIC_FUNCTIONAL_LEFT #undef BOOST_NUMERIC_FUNCTIONAL_DEDUCED #undef BOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP +#undef BOOST_NUMERIC_FUNCTIONAL_DEFINE_OP_INSTANCE #undef BOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP namespace functional @@ -437,6 +443,7 @@ namespace boost { namespace numeric {}; } +#if defined(BOOST_MSVC) inline op::min_assign const &min_assign = boost::detail::pod_singleton::instance; inline op::max_assign const &max_assign = boost::detail::pod_singleton::instance; inline op::fdiv const &fdiv = boost::detail::pod_singleton::instance; @@ -454,6 +461,28 @@ namespace boost { namespace numeric BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_max) BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) +#else + namespace + { + op::min_assign const &min_assign = boost::detail::pod_singleton::instance; + op::max_assign const &max_assign = boost::detail::pod_singleton::instance; + op::fdiv const &fdiv = boost::detail::pod_singleton::instance; + op::fdiv const &average = boost::detail::pod_singleton::instance; ///< INTERNAL ONLY + op::as_min const &as_min = boost::detail::pod_singleton::instance; + op::as_max const &as_max = boost::detail::pod_singleton::instance; + op::as_zero const &as_zero = boost::detail::pod_singleton::instance; + op::as_one const &as_one = boost::detail::pod_singleton::instance; + + BOOST_ACCUMULATORS_IGNORE_GLOBAL(min_assign) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(max_assign) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(fdiv) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(average) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_min) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_max) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) + BOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) + } +#endif /////////////////////////////////////////////////////////////////////////////// // promote diff --git a/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp b/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp index fdb01a7b..e366addc 100644 --- a/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp +++ b/upstream/boost/boost/accumulators/numeric/functional_fwd.hpp @@ -59,6 +59,17 @@ namespace boost { namespace numeric struct are_integral; } +#if defined(BOOST_MSVC) +#define BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE(Name) \ + extern op::Name const &Name; +#else +#define BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE(Name) \ + namespace \ + { \ + extern op::Name const &Name; \ + } +#endif + /// INTERNAL ONLY /// #define BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(Name, Op) \ @@ -73,10 +84,7 @@ namespace boost { namespace numeric { \ struct Name; \ } \ - namespace \ - { \ - extern op::Name const &Name; \ - } + BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE(Name) /// INTERNAL ONLY /// @@ -99,10 +107,7 @@ namespace boost { namespace numeric { \ struct Name; \ } \ - namespace \ - { \ - extern op::Name const &Name; \ - } + BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE(Name) BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(plus) BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(minus) @@ -128,6 +133,7 @@ namespace boost { namespace numeric BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(complement, ~) BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(logical_not, !) +#undef BOOST_NUMERIC_FUNCTIONAL_DECLARE_OP_INSTANCE #undef BOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP #undef BOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP @@ -182,6 +188,7 @@ namespace boost { namespace numeric struct as_one; } +#if defined(BOOST_MSVC) extern op::min_assign const &min_assign; extern op::max_assign const &max_assign; extern op::fdiv const &fdiv; @@ -189,6 +196,18 @@ namespace boost { namespace numeric extern op::as_max const &as_max; extern op::as_zero const &as_zero; extern op::as_one const &as_one; +#else + namespace + { + extern op::min_assign const &min_assign; + extern op::max_assign const &max_assign; + extern op::fdiv const &fdiv; + extern op::as_min const &as_min; + extern op::as_max const &as_max; + extern op::as_zero const &as_zero; + extern op::as_one const &as_one; + } +#endif template typename lazy_disable_if, mpl::if_, To &, To> >::type diff --git a/upstream/boost/boost/asio/execution/allocator.hpp b/upstream/boost/boost/asio/execution/allocator.hpp index 8cacb0a8..6acb193c 100644 --- a/upstream/boost/boost/asio/execution/allocator.hpp +++ b/upstream/boost/boost/asio/execution/allocator.hpp @@ -87,7 +87,7 @@ struct allocator_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template @@ -170,7 +170,7 @@ struct allocator_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/execution/blocking.hpp b/upstream/boost/boost/asio/execution/blocking.hpp index e1ee4872..a5199d3d 100644 --- a/upstream/boost/boost/asio/execution/blocking.hpp +++ b/upstream/boost/boost/asio/execution/blocking.hpp @@ -236,7 +236,7 @@ struct blocking_t template struct proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template @@ -258,7 +258,7 @@ struct blocking_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/execution/blocking_adaptation.hpp b/upstream/boost/boost/asio/execution/blocking_adaptation.hpp index f15a8fc4..e65536be 100644 --- a/upstream/boost/boost/asio/execution/blocking_adaptation.hpp +++ b/upstream/boost/boost/asio/execution/blocking_adaptation.hpp @@ -186,7 +186,7 @@ struct blocking_adaptation_t template struct proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template @@ -208,7 +208,7 @@ struct blocking_adaptation_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/execution/context.hpp b/upstream/boost/boost/asio/execution/context.hpp index e16f903f..82271642 100644 --- a/upstream/boost/boost/asio/execution/context.hpp +++ b/upstream/boost/boost/asio/execution/context.hpp @@ -86,7 +86,7 @@ struct context_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/execution/inline_exception_handling.hpp b/upstream/boost/boost/asio/execution/inline_exception_handling.hpp index 776444e1..ca94aa2f 100644 --- a/upstream/boost/boost/asio/execution/inline_exception_handling.hpp +++ b/upstream/boost/boost/asio/execution/inline_exception_handling.hpp @@ -234,7 +234,7 @@ struct inline_exception_handling_t template struct proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template @@ -256,7 +256,7 @@ struct inline_exception_handling_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/execution/mapping.hpp b/upstream/boost/boost/asio/execution/mapping.hpp index af086bce..a940f3a9 100644 --- a/upstream/boost/boost/asio/execution/mapping.hpp +++ b/upstream/boost/boost/asio/execution/mapping.hpp @@ -220,7 +220,7 @@ struct mapping_t template struct proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template @@ -242,7 +242,7 @@ struct mapping_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/execution/occupancy.hpp b/upstream/boost/boost/asio/execution/occupancy.hpp index 011d0cbc..dc1cc859 100644 --- a/upstream/boost/boost/asio/execution/occupancy.hpp +++ b/upstream/boost/boost/asio/execution/occupancy.hpp @@ -79,7 +79,7 @@ struct occupancy_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/execution/outstanding_work.hpp b/upstream/boost/boost/asio/execution/outstanding_work.hpp index c6343dd1..a4331d4f 100644 --- a/upstream/boost/boost/asio/execution/outstanding_work.hpp +++ b/upstream/boost/boost/asio/execution/outstanding_work.hpp @@ -181,7 +181,7 @@ struct outstanding_work_t template struct proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template @@ -203,7 +203,7 @@ struct outstanding_work_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/execution/relationship.hpp b/upstream/boost/boost/asio/execution/relationship.hpp index 9e7bd844..c6ea9730 100644 --- a/upstream/boost/boost/asio/execution/relationship.hpp +++ b/upstream/boost/boost/asio/execution/relationship.hpp @@ -181,7 +181,7 @@ struct relationship_t template struct proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template @@ -203,7 +203,7 @@ struct relationship_t template struct static_proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/prefer.hpp b/upstream/boost/boost/asio/prefer.hpp index 6b77840f..9484e9f6 100644 --- a/upstream/boost/boost/asio/prefer.hpp +++ b/upstream/boost/boost/asio/prefer.hpp @@ -395,7 +395,8 @@ struct impl struct proxy { #if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) \ - && defined(BOOST_ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) + && defined(BOOST_ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) \ + && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/query.hpp b/upstream/boost/boost/asio/query.hpp index bc54cc37..f3271a91 100644 --- a/upstream/boost/boost/asio/query.hpp +++ b/upstream/boost/boost/asio/query.hpp @@ -194,7 +194,7 @@ struct impl template struct proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/require.hpp b/upstream/boost/boost/asio/require.hpp index a320fe6a..704a57b0 100644 --- a/upstream/boost/boost/asio/require.hpp +++ b/upstream/boost/boost/asio/require.hpp @@ -285,7 +285,7 @@ struct impl template struct proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/asio/require_concept.hpp b/upstream/boost/boost/asio/require_concept.hpp index 5f795f6f..dd4be0cd 100644 --- a/upstream/boost/boost/asio/require_concept.hpp +++ b/upstream/boost/boost/asio/require_concept.hpp @@ -220,7 +220,7 @@ struct impl template struct proxy { -#if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT) +#if defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT) && !defined(BOOST_ASIO_MSVC) struct type { template diff --git a/upstream/boost/boost/charconv/detail/from_chars_integer_impl.hpp b/upstream/boost/boost/charconv/detail/from_chars_integer_impl.hpp index 6680c06a..f11ab779 100644 --- a/upstream/boost/boost/charconv/detail/from_chars_integer_impl.hpp +++ b/upstream/boost/boost/charconv/detail/from_chars_integer_impl.hpp @@ -24,7 +24,7 @@ namespace boost { namespace charconv { namespace detail { #if !(defined(BOOST_CHARCONV_ENABLE_CUDA) && defined(__CUDACC__)) -static constexpr unsigned char uchar_values[] = +inline constexpr unsigned char uchar_values[] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -44,7 +44,7 @@ static constexpr unsigned char uchar_values[] = static_assert(sizeof(uchar_values) == 256, "uchar_values should represent all 256 values of unsigned char"); -static constexpr double log_2_table[] = +inline constexpr double log_2_table[] = { 0.0, 0.0, diff --git a/upstream/boost/boost/charconv/detail/to_chars_integer_impl.hpp b/upstream/boost/boost/charconv/detail/to_chars_integer_impl.hpp index 79066d82..8514b60a 100644 --- a/upstream/boost/boost/charconv/detail/to_chars_integer_impl.hpp +++ b/upstream/boost/boost/charconv/detail/to_chars_integer_impl.hpp @@ -29,7 +29,7 @@ namespace boost { namespace charconv { namespace detail { -static constexpr char radix_table[] = { +inline constexpr char radix_table[] = { '0', '0', '0', '1', '0', '2', '0', '3', '0', '4', '0', '5', '0', '6', '0', '7', '0', '8', '0', '9', '1', '0', '1', '1', '1', '2', '1', '3', '1', '4', @@ -54,7 +54,7 @@ static constexpr char radix_table[] = { #if !(defined(BOOST_CHARCONV_ENABLE_CUDA) && defined(__CUDACC__)) -static constexpr char digit_table[] = { +inline constexpr char digit_table[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', diff --git a/upstream/boost/boost/decimal/detail/cmath/impl/sqrt_lookup.hpp b/upstream/boost/boost/decimal/detail/cmath/impl/sqrt_lookup.hpp index 85d29b3f..5de55f34 100644 --- a/upstream/boost/boost/decimal/detail/cmath/impl/sqrt_lookup.hpp +++ b/upstream/boost/boost/decimal/detail/cmath/impl/sqrt_lookup.hpp @@ -35,7 +35,7 @@ namespace detail { namespace sqrt_lookup { // recip_sqrt_k0s[i] = 10^16 / sqrt(1 + i * 0.1) at left edge of bin -static constexpr std::uint64_t recip_sqrt_k0s[90] = { +inline constexpr std::uint64_t recip_sqrt_k0s[90] = { 10000000000000000ULL, 9534625892455923ULL, 9128709291752768ULL, 8770580193070292ULL, 8451542547285165ULL, 8164965809277260ULL, 7905694150420948ULL, 7669649888473704ULL, 7453559924999298ULL, 7254762501100116ULL, 7071067811865475ULL, 6900655593423542ULL, @@ -62,7 +62,7 @@ static constexpr std::uint64_t recip_sqrt_k0s[90] = { }; // recip_sqrt_k1s[i] = k0[i] - k0[i+1] (slope for linear interpolation) -static constexpr std::uint64_t recip_sqrt_k1s[90] = { +inline constexpr std::uint64_t recip_sqrt_k1s[90] = { 465374107544077ULL, 405916600703155ULL, 358129098682476ULL, 319037645785127ULL, 286576738007905ULL, 259271658856312ULL, 236044261947244ULL, 216089963474406ULL, 198797423899182ULL, 183694689234641ULL, 170412218441933ULL, 158656968791122ULL, diff --git a/upstream/boost/boost/decimal/detail/int128/detail/config.hpp b/upstream/boost/boost/decimal/detail/int128/detail/config.hpp index 6118b06b..cb07c3eb 100644 --- a/upstream/boost/boost/decimal/detail/int128/detail/config.hpp +++ b/upstream/boost/boost/decimal/detail/int128/detail/config.hpp @@ -246,7 +246,11 @@ using builtin_u128 = std::_Unsigned128; # define BOOST_DECIMAL_DETAIL_INT128_INLINE_CONSTEXPR inline constexpr # define BOOST_DECIMAL_DETAIL_INT128_EXPORT export #else -# define BOOST_DECIMAL_DETAIL_INT128_INLINE_CONSTEXPR static constexpr +# if defined(__cplusplus) && __cplusplus >= 201703L +# define BOOST_DECIMAL_DETAIL_INT128_INLINE_CONSTEXPR inline constexpr +# else +# define BOOST_DECIMAL_DETAIL_INT128_INLINE_CONSTEXPR static constexpr +# endif # define BOOST_DECIMAL_DETAIL_INT128_EXPORT #endif diff --git a/upstream/boost/boost/histogram/axis/option.hpp b/upstream/boost/boost/histogram/axis/option.hpp index e71999b9..9ecf3087 100644 --- a/upstream/boost/boost/histogram/axis/option.hpp +++ b/upstream/boost/boost/histogram/axis/option.hpp @@ -75,10 +75,10 @@ using circular_t = bit<2>; using growth_t = bit<3>; constexpr none_t none{}; ///< Instance of `none_t`. -constexpr underflow_t underflow{}; ///< Instance of `underflow_t`. -constexpr overflow_t overflow{}; ///< Instance of `overflow_t`. -constexpr circular_t circular{}; ///< Instance of `circular_t`. -constexpr growth_t growth{}; ///< Instance of `growth_t`. +inline constexpr underflow_t underflow{}; ///< Instance of `underflow_t`. +inline constexpr overflow_t overflow{}; ///< Instance of `overflow_t`. +inline constexpr circular_t circular{}; ///< Instance of `circular_t`. +inline constexpr growth_t growth{}; ///< Instance of `growth_t`. } // namespace option } // namespace axis diff --git a/upstream/boost/boost/json/detail/literals.hpp b/upstream/boost/boost/json/detail/literals.hpp index 215461e7..76f8e5a9 100644 --- a/upstream/boost/boost/json/detail/literals.hpp +++ b/upstream/boost/boost/json/detail/literals.hpp @@ -28,7 +28,7 @@ enum class literals resume, }; -constexpr char const* literal_strings[] = { +BOOST_INLINE_CONSTEXPR char const* literal_strings[] = { "null", "true", "false", @@ -38,7 +38,7 @@ constexpr char const* literal_strings[] = { "", }; -constexpr std::size_t literal_sizes[] = { +BOOST_INLINE_CONSTEXPR std::size_t literal_sizes[] = { 4, 4, 5, diff --git a/upstream/boost/boost/math/special_functions/detail/lambert_w_lookup_table.ipp b/upstream/boost/boost/math/special_functions/detail/lambert_w_lookup_table.ipp index 9f1b488e..ff18274d 100644 --- a/upstream/boost/boost/math/special_functions/detail/lambert_w_lookup_table.ipp +++ b/upstream/boost/boost/math/special_functions/detail/lambert_w_lookup_table.ipp @@ -21,21 +21,21 @@ namespace math { namespace lambert_w_detail { namespace lambert_w_lookup { -static constexpr std::size_t noof_sqrts = 12; -static constexpr std::size_t noof_halves = 12; -static constexpr std::size_t noof_w0es = 65; -static constexpr std::size_t noof_w0zs = 65; -static constexpr std::size_t noof_wm1es = 64; -static constexpr std::size_t noof_wm1zs = 64; +BOOST_INLINE_CONSTEXPR std::size_t noof_sqrts = 12; +BOOST_INLINE_CONSTEXPR std::size_t noof_halves = 12; +BOOST_INLINE_CONSTEXPR std::size_t noof_w0es = 65; +BOOST_INLINE_CONSTEXPR std::size_t noof_w0zs = 65; +BOOST_INLINE_CONSTEXPR std::size_t noof_wm1es = 64; +BOOST_INLINE_CONSTEXPR std::size_t noof_wm1zs = 64; -static constexpr lookup_t halves[noof_halves] = +BOOST_INLINE_CONSTEXPR lookup_t halves[noof_halves] = { // Common to Lambert W0 and W-1 (and exactly representable). static_cast(0.5L), static_cast(0.25L), static_cast(0.125L), static_cast(0.0625L), static_cast(0.03125L), static_cast(0.015625L), static_cast(0.0078125L), static_cast(0.00390625L), static_cast(0.001953125L), static_cast(0.0009765625L), static_cast(0.00048828125L), static_cast(0.000244140625L) }; // halves, 0.5, 0.25, ... 0.000244140625, common to W0 and W-1. -static constexpr lookup_t sqrtw0s[noof_sqrts] = +BOOST_INLINE_CONSTEXPR lookup_t sqrtw0s[noof_sqrts] = { // For Lambert W0 only. static_cast(0.6065306597126334242631173765403218567L), static_cast(0.7788007830714048686684607000907199500L), static_cast(0.8824969025845954031047175929687018290L), static_cast(0.9394130628134757862473572557999761753L), @@ -45,7 +45,7 @@ static constexpr lookup_t sqrtw0s[noof_sqrts] = static_cast(0.9995118379398893653889967919448497792L), static_cast(0.9997558891748972165136242351259789505L) }; // sqrtw0s -static constexpr lookup_t sqrtwm1s[noof_sqrts] = +BOOST_INLINE_CONSTEXPR lookup_t sqrtwm1s[noof_sqrts] = { // For Lambert W-1 only. static_cast(1.648721270700128146848650787814163572L), static_cast(1.284025416687741484073420568062436458L), static_cast(1.133148453066826316829007227811793873L), static_cast(1.064494458917859429563390594642889673L), @@ -55,7 +55,7 @@ static constexpr lookup_t sqrtwm1s[noof_sqrts] = static_cast(1.000488400478694473126173623807163354L), static_cast(1.000244170429747854937005233924135774L) }; // sqrtwm1s -static constexpr lookup_t w0es[noof_w0zs] = +BOOST_INLINE_CONSTEXPR lookup_t w0es[noof_w0zs] = { // Fukushima e powers array e[0] = 2.718, 1., e[2] = e^-1 = 0.135, e[3] = e^-2 = 0.133 ... e[64] = 4.3596100000630809736231248158884615452e-28. static_cast(2.7182818284590452353602874713526624978e+00L), static_cast(1.0000000000000000000000000000000000000e+00L), static_cast(3.6787944117144232159552377016146086745e-01L), @@ -93,7 +93,7 @@ static constexpr lookup_t w0es[noof_w0zs] = }; // w0es -static constexpr lookup_t w0zs[noof_w0zs] = +BOOST_INLINE_CONSTEXPR lookup_t w0zs[noof_w0zs] = { // z values for W[0], W[1], W[2] ... W[64] (Fukushima array Fk). static_cast(0.0000000000000000000000000000000000000e+00L), static_cast(2.7182818284590452353602874713526624978e+00L), static_cast(1.4778112197861300454460854921150015626e+01L), static_cast(6.0256610769563003222785588963745153691e+01L), static_cast(2.1839260013257695631244104481144351361e+02L), @@ -115,7 +115,7 @@ static constexpr lookup_t w0zs[noof_w0zs] = }; // w0zs -static constexpr lookup_t wm1es[noof_wm1es] = +BOOST_INLINE_CONSTEXPR lookup_t wm1es[noof_wm1es] = { // Fukushima e array e[0] = e^1 = 2.718, e[1] = e^2 = 7.39 ... e[64] = 4.60718e+28. static_cast(2.7182818284590452353602874713526624978e+00L), static_cast(7.3890560989306502272304274605750078132e+00L), static_cast(2.0085536923187667740928529654581717897e+01L), static_cast(5.4598150033144239078110261202860878403e+01L), static_cast(1.4841315910257660342111558004055227962e+02L), @@ -136,7 +136,7 @@ static constexpr lookup_t wm1es[noof_wm1es] = static_cast(8.4383566687414544890733294803731179601e+26L), static_cast(2.2937831594696098790993528402686136005e+27L), static_cast(6.2351490808116168829092387089284697448e+27L) }; // wm1es -static constexpr lookup_t wm1zs[noof_wm1zs] = +BOOST_INLINE_CONSTEXPR lookup_t wm1zs[noof_wm1zs] = { // Fukushima G array of z values for integral K, (Fukushima Gk) g[0] (k = -1) = 1 ... g[64] = -1.0264389699511303e-26. static_cast(-3.6787944117144232159552377016146086745e-01L), static_cast(-2.7067056647322538378799898994496880682e-01L), static_cast(-1.4936120510359182893802724695018532990e-01L), static_cast(-7.3262555554936721174872085092964968848e-02L), static_cast(-3.3689734995427335483180242115742121244e-02L), diff --git a/upstream/boost/boost/move/algo/detail/adaptive_sort_merge.hpp b/upstream/boost/boost/move/algo/detail/adaptive_sort_merge.hpp index 2b45407d..dd3fdc61 100644 --- a/upstream/boost/boost/move/algo/detail/adaptive_sort_merge.hpp +++ b/upstream/boost/boost/move/algo/detail/adaptive_sort_merge.hpp @@ -102,7 +102,7 @@ namespace boost { namespace movelib { namespace detail_adaptive { -static const std::size_t AdaptiveSortInsertionSortThreshold = 16; +BOOST_INLINE_CONSTEXPR std::size_t AdaptiveSortInsertionSortThreshold = 16; //static const std::size_t AdaptiveSortInsertionSortThreshold = 4; BOOST_MOVE_STATIC_ASSERT((AdaptiveSortInsertionSortThreshold&(AdaptiveSortInsertionSortThreshold-1)) == 0); diff --git a/upstream/boost/boost/sort/common/util/algorithm.hpp b/upstream/boost/boost/sort/common/util/algorithm.hpp index 94fcc18a..ec981739 100644 --- a/upstream/boost/boost/sort/common/util/algorithm.hpp +++ b/upstream/boost/boost/sort/common/util/algorithm.hpp @@ -85,7 +85,7 @@ namespace util // // this array represent the number of bits needed for to represent the // first 256 numbers -static constexpr const uint32_t tmsb[256] = +inline constexpr const uint32_t tmsb[256] = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, diff --git a/upstream/boost/boost/system/detail/error_code.hpp b/upstream/boost/boost/system/detail/error_code.hpp index 9b418e4f..d094e0ef 100644 --- a/upstream/boost/boost/system/detail/error_code.hpp +++ b/upstream/boost/boost/system/detail/error_code.hpp @@ -55,9 +55,9 @@ bool operator==( const error_code & code, const error_condition & condition ) no std::size_t hash_value( error_code const & ec ); // boost-module (M5 B'): 原为 error_code::location() 函数内 static — gcc 模块管线在消费者 -// TU 以强符号发射函数内 static (非 COMDAT), 与库 TU 多重定义; 改命名空间作用域内部链接 -// constexpr (空 source_location, 每 TU 独立持有, 语义等价)。 -static constexpr source_location default_location = source_location(); +// TU 以强符号发射函数内 static (非 COMDAT), 与库 TU 多重定义; 改命名空间作用域 +// BOOST_INLINE_CONSTEXPR (COMDAT, 跨 MSVC/GCC/Clang 模块均可链接)。 +BOOST_INLINE_CONSTEXPR source_location default_location = source_location(); class error_code { diff --git a/upstream/boost/boost/url/detail/encode.hpp b/upstream/boost/boost/url/detail/encode.hpp index 9c6f785a..c16890a7 100644 --- a/upstream/boost/boost/url/detail/encode.hpp +++ b/upstream/boost/boost/url/detail/encode.hpp @@ -22,7 +22,7 @@ namespace urls { namespace detail { constexpr -char const* const hexdigs[] = { +BOOST_INLINE_CONSTEXPR char const* const hexdigs[] = { "0123456789ABCDEF", "0123456789abcdef" }; diff --git a/upstream/boost/boost/url/detail/replacement_field_rule.hpp b/upstream/boost/boost/url/detail/replacement_field_rule.hpp index a3ce50c2..35414c24 100644 --- a/upstream/boost/boost/url/detail/replacement_field_rule.hpp +++ b/upstream/boost/boost/url/detail/replacement_field_rule.hpp @@ -31,7 +31,7 @@ struct replacement_field_rule_t char const* end) const noexcept; }; -constexpr replacement_field_rule_t replacement_field_rule{}; +BOOST_INLINE_CONSTEXPR replacement_field_rule_t replacement_field_rule{}; // identifier ::= id_start id_continue* // id_start ::= "a"..."z" | "A"..."Z" | "_" @@ -47,12 +47,12 @@ struct identifier_rule_t char const* end) const noexcept; }; -constexpr identifier_rule_t identifier_rule{}; +BOOST_INLINE_CONSTEXPR identifier_rule_t identifier_rule{}; // arg_id ::= integer | identifier // integer ::= digit+ // digit ::= "0"..."9" -static constexpr auto arg_id_rule = +BOOST_INLINE_CONSTEXPR auto arg_id_rule = grammar::variant_rule( identifier_rule, grammar::unsigned_rule{}); @@ -67,7 +67,7 @@ struct format_spec_rule_t char const* end) const noexcept; }; -constexpr format_spec_rule_t format_spec_rule{}; +BOOST_INLINE_CONSTEXPR format_spec_rule_t format_spec_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/detail/url_impl.hpp b/upstream/boost/boost/url/detail/url_impl.hpp index 7da4eebb..c03463b3 100644 --- a/upstream/boost/boost/url/detail/url_impl.hpp +++ b/upstream/boost/boost/url/detail/url_impl.hpp @@ -28,7 +28,7 @@ class authority_view; namespace detail { -constexpr char const* const empty_c_str_ = ""; +BOOST_INLINE_CONSTEXPR char const* const empty_c_str_ = ""; // This is the private 'guts' of a // url_view, exposed so different parts diff --git a/upstream/boost/boost/url/impl/url_view.hpp b/upstream/boost/boost/url/impl/url_view.hpp index 881fcec3..21481e16 100644 --- a/upstream/boost/boost/url/impl/url_view.hpp +++ b/upstream/boost/boost/url/impl/url_view.hpp @@ -39,15 +39,16 @@ url_view(core::string_view s) // //------------------------------------------------ -struct url_view_base::shared_impl +namespace detail { +struct url_view_shared_impl : url_view { virtual - ~shared_impl() + ~url_view_shared_impl() { } - shared_impl( + url_view_shared_impl( url_view const& u) noexcept : url_view(u) { @@ -55,13 +56,14 @@ struct url_view_base::shared_impl char const*>(this + 1); } }; +} // detail inline std::shared_ptr url_view_base:: persist() const { - using T = shared_impl; + using T = detail::url_view_shared_impl; using Alloc = std::allocator; Alloc a; auto p = std::allocate_shared( diff --git a/upstream/boost/boost/url/rfc/detail/charsets.hpp b/upstream/boost/boost/url/rfc/detail/charsets.hpp index f3c82f57..b7d7017b 100644 --- a/upstream/boost/boost/url/rfc/detail/charsets.hpp +++ b/upstream/boost/boost/url/rfc/detail/charsets.hpp @@ -28,73 +28,73 @@ struct empty_chars_t } }; -constexpr +BOOST_INLINE_CONSTEXPR empty_chars_t empty_chars{}; -constexpr +BOOST_INLINE_CONSTEXPR auto user_chars = unreserved_chars + sub_delim_chars; -constexpr +BOOST_INLINE_CONSTEXPR auto password_chars = unreserved_chars + sub_delim_chars + ':'; -constexpr +BOOST_INLINE_CONSTEXPR auto userinfo_chars = password_chars; -constexpr +BOOST_INLINE_CONSTEXPR auto host_chars = unreserved_chars + sub_delim_chars; -constexpr +BOOST_INLINE_CONSTEXPR auto reg_name_chars = unreserved_chars + '-' + '.'; -constexpr +BOOST_INLINE_CONSTEXPR auto segment_chars = pchars; -constexpr +BOOST_INLINE_CONSTEXPR auto path_chars = segment_chars + '/'; -constexpr +BOOST_INLINE_CONSTEXPR auto query_chars = pchars + '/' + '?' + '[' + ']'; -constexpr +BOOST_INLINE_CONSTEXPR grammar::lut_chars query_ignore_chars = "&=+"; -constexpr +BOOST_INLINE_CONSTEXPR auto param_key_chars = pchars + '/' + '?' + '[' + ']' - '&' - '='; -constexpr +BOOST_INLINE_CONSTEXPR auto param_value_chars = pchars + '/' + '?' - '&'; -constexpr +BOOST_INLINE_CONSTEXPR auto fragment_chars = pchars + '/' + '?' + '#'; -constexpr +BOOST_INLINE_CONSTEXPR auto nocolon_pchars = pchars - ':'; diff --git a/upstream/boost/boost/url/rfc/detail/fragment_part_rule.hpp b/upstream/boost/boost/url/rfc/detail/fragment_part_rule.hpp index b6010631..e2687465 100644 --- a/upstream/boost/boost/url/rfc/detail/fragment_part_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/fragment_part_rule.hpp @@ -62,7 +62,7 @@ struct fragment_part_rule_t return t; } }; -constexpr fragment_part_rule_t fragment_part_rule{}; +BOOST_INLINE_CONSTEXPR fragment_part_rule_t fragment_part_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/h16_rule.hpp b/upstream/boost/boost/url/rfc/detail/h16_rule.hpp index 8649afe4..fbf1f5a6 100644 --- a/upstream/boost/boost/url/rfc/detail/h16_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/h16_rule.hpp @@ -51,7 +51,7 @@ struct h16_rule_t system::result; }; -constexpr h16_rule_t h16_rule{}; +BOOST_INLINE_CONSTEXPR h16_rule_t h16_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/hier_part_rule.hpp b/upstream/boost/boost/url/rfc/detail/hier_part_rule.hpp index d3c110c8..9500caf6 100644 --- a/upstream/boost/boost/url/rfc/detail/hier_part_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/hier_part_rule.hpp @@ -53,7 +53,7 @@ struct hier_part_rule_t system::result; }; -constexpr hier_part_rule_t hier_part_rule{}; +BOOST_INLINE_CONSTEXPR hier_part_rule_t hier_part_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/host_rule.hpp b/upstream/boost/boost/url/rfc/detail/host_rule.hpp index 2a6c09e1..46a7b973 100644 --- a/upstream/boost/boost/url/rfc/detail/host_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/host_rule.hpp @@ -58,7 +58,7 @@ struct host_rule_t system::result; }; -constexpr host_rule_t host_rule{}; +BOOST_INLINE_CONSTEXPR host_rule_t host_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/ip_literal_rule.hpp b/upstream/boost/boost/url/rfc/detail/ip_literal_rule.hpp index de590c03..5c437b67 100644 --- a/upstream/boost/boost/url/rfc/detail/ip_literal_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/ip_literal_rule.hpp @@ -52,7 +52,7 @@ struct ip_literal_rule_t system::result; }; -constexpr ip_literal_rule_t ip_literal_rule{}; +BOOST_INLINE_CONSTEXPR ip_literal_rule_t ip_literal_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/ipv6_addrz_rule.hpp b/upstream/boost/boost/url/rfc/detail/ipv6_addrz_rule.hpp index 601786df..99b637c1 100644 --- a/upstream/boost/boost/url/rfc/detail/ipv6_addrz_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/ipv6_addrz_rule.hpp @@ -48,7 +48,7 @@ struct ipv6_addrz_rule_t system::result; }; -constexpr ipv6_addrz_rule_t ipv6_addrz_rule{}; +BOOST_INLINE_CONSTEXPR ipv6_addrz_rule_t ipv6_addrz_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/ipvfuture_rule.hpp b/upstream/boost/boost/url/rfc/detail/ipvfuture_rule.hpp index 12fc1040..afa1ec10 100644 --- a/upstream/boost/boost/url/rfc/detail/ipvfuture_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/ipvfuture_rule.hpp @@ -47,7 +47,7 @@ struct ipvfuture_rule_t system::result; }; -constexpr ipvfuture_rule_t ipvfuture_rule{}; +BOOST_INLINE_CONSTEXPR ipvfuture_rule_t ipvfuture_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/path_rules.hpp b/upstream/boost/boost/url/rfc/detail/path_rules.hpp index 3f47dfc4..8dcfab9f 100644 --- a/upstream/boost/boost/url/rfc/detail/path_rules.hpp +++ b/upstream/boost/boost/url/rfc/detail/path_rules.hpp @@ -34,7 +34,7 @@ namespace detail { @see @ref grammar::parse. */ -constexpr auto segment_rule = +BOOST_INLINE_CONSTEXPR auto segment_rule = pct_encoded_rule(pchars); } // detail diff --git a/upstream/boost/boost/url/rfc/detail/port_rule.hpp b/upstream/boost/boost/url/rfc/detail/port_rule.hpp index 5893d699..984a33aa 100644 --- a/upstream/boost/boost/url/rfc/detail/port_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/port_rule.hpp @@ -87,7 +87,7 @@ struct port_part_rule_t system::result; }; -constexpr port_part_rule_t port_part_rule{}; +BOOST_INLINE_CONSTEXPR port_part_rule_t port_part_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/query_part_rule.hpp b/upstream/boost/boost/url/rfc/detail/query_part_rule.hpp index c09e248e..e4308b7d 100644 --- a/upstream/boost/boost/url/rfc/detail/query_part_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/query_part_rule.hpp @@ -88,7 +88,7 @@ struct query_part_rule_t } }; -constexpr query_part_rule_t query_part_rule{}; +BOOST_INLINE_CONSTEXPR query_part_rule_t query_part_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/reg_name_rule.hpp b/upstream/boost/boost/url/rfc/detail/reg_name_rule.hpp index 3fa2c80c..fac0130b 100644 --- a/upstream/boost/boost/url/rfc/detail/reg_name_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/reg_name_rule.hpp @@ -46,7 +46,7 @@ namespace detail { @li Errata ID: 4942 */ -constexpr auto reg_name_rule = +BOOST_INLINE_CONSTEXPR auto reg_name_rule = pct_encoded_rule(unreserved_chars + sub_delim_chars); } // detail diff --git a/upstream/boost/boost/url/rfc/detail/relative_part_rule.hpp b/upstream/boost/boost/url/rfc/detail/relative_part_rule.hpp index 9bbb3ca4..d7c4c585 100644 --- a/upstream/boost/boost/url/rfc/detail/relative_part_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/relative_part_rule.hpp @@ -59,7 +59,7 @@ struct relative_part_rule_t system::result; }; -constexpr relative_part_rule_t relative_part_rule{}; +BOOST_INLINE_CONSTEXPR relative_part_rule_t relative_part_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/rfc/detail/userinfo_rule.hpp b/upstream/boost/boost/url/rfc/detail/userinfo_rule.hpp index 525d8710..6d3c8a12 100644 --- a/upstream/boost/boost/url/rfc/detail/userinfo_rule.hpp +++ b/upstream/boost/boost/url/rfc/detail/userinfo_rule.hpp @@ -51,7 +51,7 @@ struct userinfo_rule_t system::result; }; -constexpr userinfo_rule_t userinfo_rule{}; +BOOST_INLINE_CONSTEXPR userinfo_rule_t userinfo_rule{}; } // detail } // urls diff --git a/upstream/boost/boost/url/url_view_base.hpp b/upstream/boost/boost/url/url_view_base.hpp index 1b81eb42..2164d19f 100644 --- a/upstream/boost/boost/url/url_view_base.hpp +++ b/upstream/boost/boost/url/url_view_base.hpp @@ -65,9 +65,11 @@ struct pattern; class BOOST_SYMBOL_VISIBLE url_view_base : private detail::parts_base { +protected: detail::url_impl impl_; detail::url_impl const* external_impl_; +private: friend class url; friend class url_base; friend class url_view; @@ -86,8 +88,7 @@ class BOOST_SYMBOL_VISIBLE url_view_base friend class segments_view; friend struct detail::pattern; - struct shared_impl; - +protected: // Returns reference to the active implementation. // Uses external_impl_ if set, otherwise local impl_. BOOST_URL_CXX14_CONSTEXPR @@ -112,7 +113,6 @@ class BOOST_SYMBOL_VISIBLE url_view_base { } -protected: ~url_view_base() = default; BOOST_URL_CXX14_CONSTEXPR From b3aab55991eb9b688291e69c46a746151f7534cf Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 09:38:13 +0000 Subject: [PATCH 17/21] fix(msvc,gcc): fix remaining 9 MSVC test failures (winapi, mqtt5, url RangeRule, interprocess win32_api, describe) and gcc duplicate constexpr --- generated/exports/interprocess.inc | 5 +- generated/exports/mqtt5.inc | 62 +++- generated/exports/winapi.inc | 4 +- generated/meta/api-surface.json | 6 +- generated/meta/skipped.txt | 3 + mcpp.toml | 9 +- patches/interprocess.patch | 24 ++ patches/mqtt5.patch | 297 ++++++++++++++++++ patches/url.patch | 33 +- patches/winapi.patch | 26 ++ tests/describe/include_examples.cpp | 20 +- tools/apply_patches.py | 2 +- tools/export_policy.toml | 3 + .../boost/interprocess/detail/win32_api.hpp | 6 +- .../boost/mqtt5/detail/control_packet.hpp | 8 +- .../boost/mqtt5/detail/topic_validation.hpp | 2 +- .../boost/mqtt5/impl/codecs/base_decoders.hpp | 2 +- .../boost/mqtt5/impl/codecs/base_encoders.hpp | 18 +- upstream/boost/boost/mqtt5/reason_codes.hpp | 92 +++--- upstream/boost/boost/url/detail/encode.hpp | 1 - .../boost/boost/url/grammar/range_rule.hpp | 8 + upstream/boost/boost/winapi/handles.hpp | 6 +- 22 files changed, 547 insertions(+), 90 deletions(-) create mode 100644 patches/winapi.patch diff --git a/generated/exports/interprocess.inc b/generated/exports/interprocess.inc index 7f86ac33..35976277 100644 --- a/generated/exports/interprocess.inc +++ b/generated/exports/interprocess.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=interprocess boost=1.92.0 target=x86_64-w64-mingw32 entities=727 +// lib=interprocess boost=1.92.0 target=x86_64-w64-mingw32 entities=730 export namespace boost { using boost::has_trivial_destructor; @@ -733,6 +733,7 @@ export namespace boost { namespace interprocess { namespace winapi { using boost::interprocess::winapi::get_tick_count; using boost::interprocess::winapi::handle_closer; using boost::interprocess::winapi::hkey; + using boost::interprocess::winapi::hkey_local_machine; using boost::interprocess::winapi::hmodule; using boost::interprocess::winapi::initialize_object_attributes; using boost::interprocess::winapi::interlocked_compare_exchange; @@ -749,8 +750,10 @@ export namespace boost { namespace interprocess { namespace winapi { using boost::interprocess::winapi::interprocess_security_descriptor; using boost::interprocess::winapi::interprocess_semaphore_basic_information; using boost::interprocess::winapi::interprocess_system_info; + using boost::interprocess::winapi::invalid_handle_value; using boost::interprocess::winapi::io_status_block_t; using boost::interprocess::winapi::is_directory; + using boost::interprocess::winapi::key_query_value; using boost::interprocess::winapi::library_unloader; using boost::interprocess::winapi::load_library; using boost::interprocess::winapi::local_free; diff --git a/generated/exports/mqtt5.inc b/generated/exports/mqtt5.inc index fbb0f26c..7d9c2bea 100644 --- a/generated/exports/mqtt5.inc +++ b/generated/exports/mqtt5.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=mqtt5 boost=1.92.0 target=x86_64-w64-mingw32 entities=327 +// lib=mqtt5 boost=1.92.0 target=x86_64-w64-mingw32 entities=387 export namespace boost { namespace asio { namespace ssl { using boost::asio::ssl::stream; @@ -161,6 +161,8 @@ export namespace boost { namespace mqtt5 { namespace detail { using boost::mqtt5::detail::control_packet; using boost::mqtt5::detail::credentials; using boost::mqtt5::detail::data_span; + using boost::mqtt5::detail::default_max_recv_size; + using boost::mqtt5::detail::default_max_send_size; using boost::mqtt5::detail::disconnect_ctx; using boost::mqtt5::detail::disconnect_op; using boost::mqtt5::detail::disconnect_rc_e; @@ -208,6 +210,7 @@ export namespace boost { namespace mqtt5 { namespace detail { using boost::mqtt5::detail::next_layer_sig; using boost::mqtt5::detail::next_layer_type; using boost::mqtt5::detail::next_layer_type_impl; + using boost::mqtt5::detail::no_pid; using boost::mqtt5::detail::no_pid_; using boost::mqtt5::detail::on_publish_props_type; using boost::mqtt5::detail::on_publish_signature; @@ -229,6 +232,7 @@ export namespace boost { namespace mqtt5 { namespace detail { using boost::mqtt5::detail::serial_num_t; using boost::mqtt5::detail::session_state; using boost::mqtt5::detail::setup_tls_sni; + using boost::mqtt5::detail::shared_sub_prefix; using boost::mqtt5::detail::shutdown_op; using boost::mqtt5::detail::stream_context; using boost::mqtt5::detail::subscribe_op; @@ -249,6 +253,7 @@ export namespace boost { namespace mqtt5 { namespace detail { using boost::mqtt5::detail::validate_topic_filter; using boost::mqtt5::detail::validate_topic_name; using boost::mqtt5::detail::validation_result; + using boost::mqtt5::detail::with_pid; using boost::mqtt5::detail::with_pid_; using boost::mqtt5::detail::write_handler_t; using boost::mqtt5::detail::write_op; @@ -277,24 +282,33 @@ export namespace boost { namespace mqtt5 { namespace encoders { export namespace boost { namespace mqtt5 { namespace encoders { namespace basic { using boost::mqtt5::encoders::basic::array_def; using boost::mqtt5::encoders::basic::array_val; + using boost::mqtt5::encoders::basic::binary_; + using boost::mqtt5::encoders::basic::byte_; using boost::mqtt5::encoders::basic::composed_val; using boost::mqtt5::encoders::basic::encoder; using boost::mqtt5::encoders::basic::flag; using boost::mqtt5::encoders::basic::flag_def; + using boost::mqtt5::encoders::basic::int16_; + using boost::mqtt5::encoders::basic::int32_; using boost::mqtt5::encoders::basic::int_def; using boost::mqtt5::encoders::basic::int_val; using boost::mqtt5::encoders::basic::operator&; using boost::mqtt5::encoders::basic::operator<<; using boost::mqtt5::encoders::basic::to_variable_bytes; + using boost::mqtt5::encoders::basic::utf8_; using boost::mqtt5::encoders::basic::utf8_def; using boost::mqtt5::encoders::basic::variable_length; using boost::mqtt5::encoders::basic::varint_t; + using boost::mqtt5::encoders::basic::varlen_; + using boost::mqtt5::encoders::basic::verbatim_; }}}} export namespace boost { namespace mqtt5 { namespace encoders { namespace prop { using boost::mqtt5::encoders::prop::encoder_for_prop_value; using boost::mqtt5::encoders::prop::prop_val; + using boost::mqtt5::encoders::prop::props_; using boost::mqtt5::encoders::prop::props_def; + using boost::mqtt5::encoders::prop::props_may_omit_; using boost::mqtt5::encoders::prop::props_val; }}}} @@ -363,7 +377,53 @@ export namespace boost { namespace mqtt5 { namespace prop { }}} export namespace boost { namespace mqtt5 { namespace reason_codes { + using boost::mqtt5::reason_codes::administrative_action; + using boost::mqtt5::reason_codes::bad_authentication_method; + using boost::mqtt5::reason_codes::bad_username_or_password; + using boost::mqtt5::reason_codes::banned; using boost::mqtt5::reason_codes::category; + using boost::mqtt5::reason_codes::client_identifier_not_valid; + using boost::mqtt5::reason_codes::connection_rate_exceeded; + using boost::mqtt5::reason_codes::continue_authentication; + using boost::mqtt5::reason_codes::disconnect_with_will_message; + using boost::mqtt5::reason_codes::empty; + using boost::mqtt5::reason_codes::granted_qos_0; + using boost::mqtt5::reason_codes::granted_qos_1; + using boost::mqtt5::reason_codes::granted_qos_2; + using boost::mqtt5::reason_codes::implementation_specific_error; + using boost::mqtt5::reason_codes::keep_alive_timeout; + using boost::mqtt5::reason_codes::malformed_packet; + using boost::mqtt5::reason_codes::maximum_connect_time; + using boost::mqtt5::reason_codes::message_rate_too_high; + using boost::mqtt5::reason_codes::no_matching_subscribers; + using boost::mqtt5::reason_codes::no_subscription_existed; + using boost::mqtt5::reason_codes::normal_disconnection; + using boost::mqtt5::reason_codes::not_authorized; + using boost::mqtt5::reason_codes::packet_identifier_in_use; + using boost::mqtt5::reason_codes::packet_identifier_not_found; + using boost::mqtt5::reason_codes::packet_too_large; + using boost::mqtt5::reason_codes::payload_format_invalid; + using boost::mqtt5::reason_codes::protocol_error; + using boost::mqtt5::reason_codes::qos_not_supported; + using boost::mqtt5::reason_codes::quota_exceeded; + using boost::mqtt5::reason_codes::reauthenticate; + using boost::mqtt5::reason_codes::receive_maximum_exceeded; + using boost::mqtt5::reason_codes::retain_not_supported; + using boost::mqtt5::reason_codes::server_busy; + using boost::mqtt5::reason_codes::server_moved; + using boost::mqtt5::reason_codes::server_shutting_down; + using boost::mqtt5::reason_codes::server_unavailable; + using boost::mqtt5::reason_codes::session_taken_over; + using boost::mqtt5::reason_codes::shared_subscriptions_not_supported; + using boost::mqtt5::reason_codes::subscription_ids_not_supported; + using boost::mqtt5::reason_codes::success; + using boost::mqtt5::reason_codes::topic_alias_invalid; + using boost::mqtt5::reason_codes::topic_filter_invalid; + using boost::mqtt5::reason_codes::topic_name_invalid; + using boost::mqtt5::reason_codes::unspecified_error; + using boost::mqtt5::reason_codes::unsupported_protocol_version; + using boost::mqtt5::reason_codes::use_another_server; + using boost::mqtt5::reason_codes::wildcard_subscriptions_not_supported; }}} export namespace boost { namespace mqtt5 { namespace reason_codes { namespace detail { diff --git a/generated/exports/winapi.inc b/generated/exports/winapi.inc index fa064f34..bd068922 100644 --- a/generated/exports/winapi.inc +++ b/generated/exports/winapi.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=winapi boost=1.92.0 target=x86_64-w64-mingw32 entities=427 +// lib=winapi boost=1.92.0 target=x86_64-w64-mingw32 entities=429 export namespace boost { namespace winapi { using ::AreFileApisANSI; @@ -211,6 +211,7 @@ export namespace boost { namespace winapi { using boost::winapi::INIT_ONCE_; using boost::winapi::INT_; using boost::winapi::INT_PTR_; + using boost::winapi::INVALID_HANDLE_VALUE_; using boost::winapi::ImagehlpApiVersion; using boost::winapi::InitOnceBeginInitialize; using boost::winapi::InitOnceComplete; @@ -413,6 +414,7 @@ export namespace boost { namespace winapi { using boost::winapi::get_proc_address; using boost::winapi::get_system_directory; using boost::winapi::get_temp_path; + using boost::winapi::invalid_handle_value; using boost::winapi::load_library; using boost::winapi::load_library_ex; using boost::winapi::move_file; diff --git a/generated/meta/api-surface.json b/generated/meta/api-surface.json index f11357fe..5341de91 100644 --- a/generated/meta/api-surface.json +++ b/generated/meta/api-surface.json @@ -1212,7 +1212,7 @@ "move", "winapi" ], - "exported": 727, + "exported": 730, "gmf": [ "boost/interprocess/allocators/adaptive_pool.hpp", "boost/interprocess/allocators/cached_adaptive_pool.hpp", @@ -1589,7 +1589,7 @@ "type_traits", "utility" ], - "exported": 327, + "exported": 387, "gmf": [ "boost/mqtt5.hpp", "boost/mqtt5/websocket.hpp" @@ -2805,7 +2805,7 @@ }, "winapi": { "deps": [], - "exported": 427, + "exported": 429, "gmf": [ "boost/winapi/bcrypt.hpp", "boost/winapi/character_code_conversion.hpp", diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index 731d6e50..8fd68732 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -413,6 +413,7 @@ interprocess guard boost::interprocess::winapi::get_temp_path if defined(_WIN32) interprocess guard boost::interprocess::winapi::get_tick_count if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::handle_closer if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::hkey if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. +interprocess guard boost::interprocess::winapi::hkey_local_machine if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::hmodule if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::initialize_object_attributes if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::interlocked_compare_exchange if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. @@ -429,8 +430,10 @@ interprocess guard boost::interprocess::winapi::interprocess_security_attributes interprocess guard boost::interprocess::winapi::interprocess_security_descriptor if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::interprocess_semaphore_basic_information if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::interprocess_system_info if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. +interprocess guard boost::interprocess::winapi::invalid_handle_value if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::io_status_block_t if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::is_directory if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. +interprocess guard boost::interprocess::winapi::key_query_value if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::library_unloader if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::load_library if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. interprocess guard boost::interprocess::winapi::local_free if defined(_WIN32) -- M12 platform guard: the interprocess::winapi surface (detail/win32_api.hpp) is Windows-only; POSIX interprocess never declares it. diff --git a/mcpp.toml b/mcpp.toml index 17d74cc6..c92ae775 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -309,10 +309,9 @@ cxxflags = ["-Wno-invalid-specialization"] # Boost headers that test __cplusplus (e.g. hana/traits.hpp) to take C++98 # branches and reference traits removed in C++20 (such as std::is_literal_type). # Heavy template test TUs (geometry, math) exceed COFF's 65535-section limit -# without /bigobj. link.exe takes foo.lib rather than -lfoo (LNK4044). +# without /bigobj. [target.'cfg(compiler = "msvc")'.build] cxxflags = ["/Zc:__cplusplus", "/bigobj"] -ldflags = ["ws2_32.lib", "ntdll.lib", "shell32.lib", "advapi32.lib", "secur32.lib", "user32.lib", "synchronization.lib"] # -- generated by tools/gen_features.py - do not edit -- [features] @@ -686,12 +685,10 @@ sources = [ "!upstream/boost/libs/thread/src/pthread/**", "!upstream/boost/libs/log/src/posix/**", ] - # System libraries the Windows TUs need, mirroring upstream's WIN32 link set # (cobalt/process sockets and process info, log's object_name, atomic's -# WaitOnAddress). Native MSVC passes *.lib in [target.'cfg(compiler = "msvc")'.build]. -[target.'cfg(os = "windows", compiler = "llvm")'.build] -ldflags = ["-lws2_32", "-lntdll", "-lshell32", "-ladvapi32", "-lsecur32", "-luser32", "-lsynchronization"] +# WaitOnAddress). Both link.exe (MSVC) and clang-cl/lld-link accept *.lib. +ldflags = ["ws2_32.lib", "ntdll.lib", "shell32.lib", "advapi32.lib", "secur32.lib", "user32.lib", "synchronization.lib"] [target.unix.build] sources = [ diff --git a/patches/interprocess.patch b/patches/interprocess.patch index 1e7d07a8..e1d2aa17 100644 --- a/patches/interprocess.patch +++ b/patches/interprocess.patch @@ -110,3 +110,27 @@ index 137409da..92dfc70d 100644 namespace ipcdetail{ +diff --git a/upstream/boost/boost/interprocess/detail/win32_api.hpp b/upstream/boost/boost/interprocess/detail/win32_api.hpp +index e206b58a..21c0cb39 100644 +--- a/upstream/boost/boost/interprocess/detail/win32_api.hpp ++++ b/upstream/boost/boost/interprocess/detail/win32_api.hpp +@@ -598,7 +598,7 @@ static const unsigned long lang_neutral = (unsigned long)0x00; + static const unsigned long sublang_default = (unsigned long)0x01; + static const unsigned long invalid_file_size = (unsigned long)0xFFFFFFFF; + static const unsigned long invalid_file_attributes = ((unsigned long)-1); +-static void * const invalid_handle_value = ((void*)(long)(-1)); ++inline void * const invalid_handle_value = ((void*)(long)(-1)); + + static const unsigned long file_type_char = 0x0002L; + static const unsigned long file_type_disk = 0x0001L; +@@ -625,8 +625,8 @@ const unsigned long max_record_buffer_size = 0x10000L; // 64K + const unsigned long max_path = 260; + + //Keys +-static const hkey hkey_local_machine = (hkey)(unsigned long*)(long)(0x80000002); +-static unsigned long key_query_value = 0x0001; ++inline const hkey hkey_local_machine = (hkey)(unsigned long*)(long)(0x80000002); ++BOOST_INLINE_CONSTEXPR unsigned long key_query_value = 0x0001; + + // Registry types + #define reg_none ( 0 ) // No value type diff --git a/patches/mqtt5.patch b/patches/mqtt5.patch index d51e3d44..784ac7b8 100644 --- a/patches/mqtt5.patch +++ b/patches/mqtt5.patch @@ -74,3 +74,300 @@ index 9741823c..684a6703 100644 DEF_PROPERTY_TRAIT(payload_format_indicator, std::optional); DEF_PROPERTY_TRAIT(message_expiry_interval, std::optional); +diff --git a/upstream/boost/boost/mqtt5/detail/control_packet.hpp b/upstream/boost/boost/mqtt5/detail/control_packet.hpp +index 2f0117fe..f775c469 100644 +--- a/upstream/boost/boost/mqtt5/detail/control_packet.hpp ++++ b/upstream/boost/boost/mqtt5/detail/control_packet.hpp +@@ -23,9 +23,9 @@ + namespace boost::mqtt5::detail { + + /* max varint number (268'435'455) + fixed header size (1 + 4) */ +-static constexpr int32_t default_max_send_size = 268'435'460; ++inline constexpr int32_t default_max_send_size = 268'435'460; + +-static constexpr int32_t default_max_recv_size = 65'536; ++inline constexpr int32_t default_max_recv_size = 65'536; + + enum class control_code_e : std::uint8_t { + no_packet = 0b00000000, // 0 +@@ -47,8 +47,8 @@ enum class control_code_e : std::uint8_t { + auth = 0b11110000, // 15 + }; + +-constexpr struct with_pid_ {} with_pid {}; +-constexpr struct no_pid_ {} no_pid {}; ++inline constexpr struct with_pid_ {} with_pid {}; ++inline constexpr struct no_pid_ {} no_pid {}; + + template + class control_packet { +diff --git a/upstream/boost/boost/mqtt5/detail/topic_validation.hpp b/upstream/boost/boost/mqtt5/detail/topic_validation.hpp +index 9de95a7a..88fc2b59 100644 +--- a/upstream/boost/boost/mqtt5/detail/topic_validation.hpp ++++ b/upstream/boost/boost/mqtt5/detail/topic_validation.hpp +@@ -18,7 +18,7 @@ namespace boost::mqtt5::detail { + static constexpr int32_t min_subscription_identifier = 1; + static constexpr int32_t max_subscription_identifier = 268'435'455; + +-static constexpr std::string_view shared_sub_prefix = "$share/"; ++inline constexpr std::string_view shared_sub_prefix = "$share/"; + + inline bool is_utf8_no_wildcard(validation_result result) { + return result == validation_result::valid; +diff --git a/upstream/boost/boost/mqtt5/impl/codecs/base_decoders.hpp b/upstream/boost/boost/mqtt5/impl/codecs/base_decoders.hpp +index 6d87ab9e..9778d0b7 100644 +--- a/upstream/boost/boost/mqtt5/impl/codecs/base_decoders.hpp ++++ b/upstream/boost/boost/mqtt5/impl/codecs/base_decoders.hpp +@@ -345,7 +345,7 @@ struct prop_parser { + }; + + template +-constexpr auto props_ = prop_parser {}; ++inline constexpr auto props_ = prop_parser {}; + + } // end namespace prop + +diff --git a/upstream/boost/boost/mqtt5/impl/codecs/base_encoders.hpp b/upstream/boost/boost/mqtt5/impl/codecs/base_encoders.hpp +index e5359d9d..669ac0fd 100644 +--- a/upstream/boost/boost/mqtt5/impl/codecs/base_encoders.hpp ++++ b/upstream/boost/boost/mqtt5/impl/codecs/base_encoders.hpp +@@ -192,10 +192,10 @@ public: + } + }; + +-constexpr auto byte_ = int_def {}; +-constexpr auto int16_ = int_def {}; +-constexpr auto int32_ = int_def {}; +-constexpr auto varlen_ = int_def {}; ++inline constexpr auto byte_ = int_def {}; ++inline constexpr auto int16_ = int_def {}; ++inline constexpr auto int32_ = int_def {}; ++inline constexpr auto varlen_ = int_def {}; + + + template +@@ -286,9 +286,9 @@ public: + + using utf8_def = array_def; + +-constexpr auto utf8_ = utf8_def {}; +-constexpr auto binary_ = array_def {}; // for now +-constexpr auto verbatim_ = array_def {}; ++inline constexpr auto utf8_ = utf8_def {}; ++inline constexpr auto binary_ = array_def {}; // for now ++inline constexpr auto verbatim_ = array_def {}; + + + template +@@ -504,8 +504,8 @@ public: + } + }; + +-constexpr auto props_ = props_def {}; +-constexpr auto props_may_omit_ = props_def {}; ++inline constexpr auto props_ = props_def {}; ++inline constexpr auto props_may_omit_ = props_def {}; + + } // end namespace prop + +diff --git a/upstream/boost/boost/mqtt5/reason_codes.hpp b/upstream/boost/boost/mqtt5/reason_codes.hpp +index 2cde5e8a..ad5fe9c8 100644 +--- a/upstream/boost/boost/mqtt5/reason_codes.hpp ++++ b/upstream/boost/boost/mqtt5/reason_codes.hpp +@@ -205,150 +205,150 @@ public: + namespace reason_codes { + + /** \brief No Reason Code. A \ref client::error occurred.*/ +-constexpr reason_code empty {}; ++inline constexpr reason_code empty {}; + + /** \brief The operation completed successfully. */ +-constexpr reason_code success { 0x00 }; ++inline constexpr reason_code success { 0x00 }; + + /** \brief Close the connection normally. Do not send the Will Message. */ +-constexpr reason_code normal_disconnection { 0x00, category::disconnect }; ++inline constexpr reason_code normal_disconnection { 0x00, category::disconnect }; + + /** \brief The subscription is accepted with maximum QoS sent at 0. */ +-constexpr reason_code granted_qos_0 { 0x00, category::suback }; ++inline constexpr reason_code granted_qos_0 { 0x00, category::suback }; + + /** \brief The subscription is accepted with maximum QoS sent at 1. */ +-constexpr reason_code granted_qos_1 { 0x01 }; ++inline constexpr reason_code granted_qos_1 { 0x01 }; + + /** \brief The subscription is accepted with maximum QoS sent at 2 */ +-constexpr reason_code granted_qos_2 { 0x02 }; ++inline constexpr reason_code granted_qos_2 { 0x02 }; + + /** \brief The Client wishes to disconnect but requires that + the Server also publishes its Will Message. */ +-constexpr reason_code disconnect_with_will_message { 0x04 }; ++inline constexpr reason_code disconnect_with_will_message { 0x04 }; + + /** \brief The message is accepted but there are no subscribers. */ +-constexpr reason_code no_matching_subscribers { 0x10 }; ++inline constexpr reason_code no_matching_subscribers { 0x10 }; + + /** \brief No matching Topic Filter is being used by the Client. */ +-constexpr reason_code no_subscription_existed { 0x11 }; ++inline constexpr reason_code no_subscription_existed { 0x11 }; + + /** \brief Continue the authentication with another step. */ +-constexpr reason_code continue_authentication { 0x18 }; ++inline constexpr reason_code continue_authentication { 0x18 }; + + /** \brief Initiate a re-authentication. */ +-constexpr reason_code reauthenticate { 0x19 }; ++inline constexpr reason_code reauthenticate { 0x19 }; + + /** \brief The Server does not wish to reveal the reason for the + failure or none of the other Reason Codes apply. */ +-constexpr reason_code unspecified_error { 0x80 }; ++inline constexpr reason_code unspecified_error { 0x80 }; + + /** \brief Data within the packet could not be correctly parsed. */ +-constexpr reason_code malformed_packet { 0x81 }; ++inline constexpr reason_code malformed_packet { 0x81 }; + + /** \brief Data in the packet does not conform to this specification. */ +-constexpr reason_code protocol_error { 0x82 }; ++inline constexpr reason_code protocol_error { 0x82 }; + + /** \brief The packet is valid but not accepted by this Server. */ +-constexpr reason_code implementation_specific_error { 0x83 }; ++inline constexpr reason_code implementation_specific_error { 0x83 }; + + /** \brief The Server does not support the requested version of the MQTT protocol. */ +-constexpr reason_code unsupported_protocol_version { 0x84 }; ++inline constexpr reason_code unsupported_protocol_version { 0x84 }; + + /** \brief The Client ID is valid but not allowed by this Server. */ +-constexpr reason_code client_identifier_not_valid { 0x85 }; ++inline constexpr reason_code client_identifier_not_valid { 0x85 }; + + /** \brief The Server does not accept the User Name or Password provided. */ +-constexpr reason_code bad_username_or_password { 0x86 }; ++inline constexpr reason_code bad_username_or_password { 0x86 }; + + /** \brief The request is not authorized. */ +-constexpr reason_code not_authorized { 0x87 }; ++inline constexpr reason_code not_authorized { 0x87 }; + + /** \brief The MQTT Server is not available. */ +-constexpr reason_code server_unavailable { 0x88 }; ++inline constexpr reason_code server_unavailable { 0x88 }; + + /** \brief The MQTT Server is busy, try again later. */ +-constexpr reason_code server_busy { 0x89 }; ++inline constexpr reason_code server_busy { 0x89 }; + + /** \brief The Client has been banned by administrative action. */ +-constexpr reason_code banned { 0x8a }; ++inline constexpr reason_code banned { 0x8a }; + + /** \brief The Server is shutting down. */ +-constexpr reason_code server_shutting_down { 0x8b }; ++inline constexpr reason_code server_shutting_down { 0x8b }; + + /** \brief The authentication method is not supported or + does not match the method currently in use. */ +-constexpr reason_code bad_authentication_method { 0x8c }; ++inline constexpr reason_code bad_authentication_method { 0x8c }; + + /** \brief No packet has been received for 1.5 times the Keepalive time. */ +-constexpr reason_code keep_alive_timeout { 0x8d }; ++inline constexpr reason_code keep_alive_timeout { 0x8d }; + + /** \brief Another Connection using the same ClientID has connected + causing this Connection to be closed. */ +-constexpr reason_code session_taken_over { 0x8e }; ++inline constexpr reason_code session_taken_over { 0x8e }; + + /** \brief The Topic Filter is not malformed, but it is not accepted. */ +-constexpr reason_code topic_filter_invalid { 0x8f }; ++inline constexpr reason_code topic_filter_invalid { 0x8f }; + + /** \brief The Topic Name is not malformed, but it is not accepted. */ +-constexpr reason_code topic_name_invalid { 0x90 }; ++inline constexpr reason_code topic_name_invalid { 0x90 }; + + /** \brief The Packet Identifier is already in use. */ +-constexpr reason_code packet_identifier_in_use { 0x91 }; ++inline constexpr reason_code packet_identifier_in_use { 0x91 }; + + /** \brief The Packet Identifier is not known. */ +-constexpr reason_code packet_identifier_not_found { 0x92 }; ++inline constexpr reason_code packet_identifier_not_found { 0x92 }; + + /** \brief The Client or Server has received more than the Receive + Maximum publication for which it has not sent PUBACK or PUBCOMP. */ +-constexpr reason_code receive_maximum_exceeded { 0x93 }; ++inline constexpr reason_code receive_maximum_exceeded { 0x93 }; + + /** \brief The Client or Server received a PUBLISH packet containing + a Topic Alias greater than the Maximum Topic Alias. */ +-constexpr reason_code topic_alias_invalid { 0x94 }; ++inline constexpr reason_code topic_alias_invalid { 0x94 }; + + /** \brief The packet exceeded the maximum permissible size. */ +-constexpr reason_code packet_too_large { 0x95 }; ++inline constexpr reason_code packet_too_large { 0x95 }; + + /** \brief The received data rate is too high. */ +-constexpr reason_code message_rate_too_high { 0x96 }; ++inline constexpr reason_code message_rate_too_high { 0x96 }; + + /** \brief An implementation or administrative imposed limit has been exceeded. */ +-constexpr reason_code quota_exceeded { 0x97 }; ++inline constexpr reason_code quota_exceeded { 0x97 }; + + /** \brief The Connection is closed due to an administrative action. */ +-constexpr reason_code administrative_action { 0x98 }; ++inline constexpr reason_code administrative_action { 0x98 }; + + /** \brief The Payload does not match the specified Payload Format Indicator. */ +-constexpr reason_code payload_format_invalid { 0x99 }; ++inline constexpr reason_code payload_format_invalid { 0x99 }; + + /** \brief The Server does not support retained messages. */ +-constexpr reason_code retain_not_supported { 0x9a }; ++inline constexpr reason_code retain_not_supported { 0x9a }; + + /** \brief The Server does not support the QoS the Client specified or + it is greater than the Maximum QoS specified. */ +-constexpr reason_code qos_not_supported { 0x9b }; ++inline constexpr reason_code qos_not_supported { 0x9b }; + + /** \brief The Client should temporarily use another server. */ +-constexpr reason_code use_another_server { 0x9c }; ++inline constexpr reason_code use_another_server { 0x9c }; + + /** \brief The Client should permanently use another server. */ +-constexpr reason_code server_moved { 0x9d }; ++inline constexpr reason_code server_moved { 0x9d }; + + /** \brief The Server does not support Shared Subscriptions for this Client. */ +-constexpr reason_code shared_subscriptions_not_supported { 0x9e }; ++inline constexpr reason_code shared_subscriptions_not_supported { 0x9e }; + + /** \brief The connection rate limit has been exceeded. */ +-constexpr reason_code connection_rate_exceeded { 0x9f }; ++inline constexpr reason_code connection_rate_exceeded { 0x9f }; + + /** \brief The maximum connection time authorized for this + connection has been exceeded. */ +-constexpr reason_code maximum_connect_time { 0xa0 }; ++inline constexpr reason_code maximum_connect_time { 0xa0 }; + + /** \brief The Server does not support Subscription Identifiers. */ +-constexpr reason_code subscription_ids_not_supported { 0xa1 }; ++inline constexpr reason_code subscription_ids_not_supported { 0xa1 }; + + /** \brief The Server does not support Wildcard Subscriptions. */ +-constexpr reason_code wildcard_subscriptions_not_supported { 0xa2 }; ++inline constexpr reason_code wildcard_subscriptions_not_supported { 0xa2 }; + + namespace detail { + diff --git a/patches/url.patch b/patches/url.patch index 638342ff..5b6ff765 100644 --- a/patches/url.patch +++ b/patches/url.patch @@ -315,13 +315,14 @@ index 27973a0b..eaccf866 100644 url_base() noexcept = default; url_base(detail::url_impl const&) noexcept; diff --git a/upstream/boost/boost/url/detail/encode.hpp b/upstream/boost/boost/url/detail/encode.hpp -index 9c6f785a..c16890a7 100644 +index 9c6f785a..e38d76ef 100644 --- a/upstream/boost/boost/url/detail/encode.hpp +++ b/upstream/boost/boost/url/detail/encode.hpp -@@ -22,7 +22,7 @@ namespace urls { +@@ -21,8 +21,7 @@ namespace boost { + namespace urls { namespace detail { - constexpr +-constexpr -char const* const hexdigs[] = { +BOOST_INLINE_CONSTEXPR char const* const hexdigs[] = { "0123456789ABCDEF", @@ -704,3 +705,29 @@ index 7d59598c..2164d19f 100644 // Returns reference to the active implementation. // Uses external_impl_ if set, otherwise local impl_. BOOST_URL_CXX14_CONSTEXPR +diff --git a/upstream/boost/boost/url/grammar/range_rule.hpp b/upstream/boost/boost/url/grammar/range_rule.hpp +index 631fb435..97fa9fec 100644 +--- a/upstream/boost/boost/url/grammar/range_rule.hpp ++++ b/upstream/boost/boost/url/grammar/range_rule.hpp +@@ -85,6 +85,13 @@ using is_range_rule = implementation_defined::is_range_rule< + RangeRule>::type>; + + #ifdef BOOST_URL_HAS_CONCEPTS ++#if defined(BOOST_MSVC) ++// MSVC's C++20 module IFC serializer drops `const` from `char const*&` in a ++// concept requires-parameter list, making RangeRule evaluate to false for ++// imported rules. Delegate to is_range_rule. ++template ++concept RangeRule = is_range_rule::value; ++#else + template + concept RangeRule = + requires (T r, char const*& it, char const* end) +@@ -94,6 +101,7 @@ concept RangeRule = + { r.next(it, end) } -> std::same_as>; + }; + #endif ++#endif + + template + class any_rule; diff --git a/patches/winapi.patch b/patches/winapi.patch new file mode 100644 index 00000000..6f69ed50 --- /dev/null +++ b/patches/winapi.patch @@ -0,0 +1,26 @@ +diff --git a/upstream/boost/boost/winapi/handles.hpp b/upstream/boost/boost/winapi/handles.hpp +index 328d3242..81e83095 100644 +--- a/upstream/boost/boost/winapi/handles.hpp ++++ b/upstream/boost/boost/winapi/handles.hpp +@@ -60,18 +60,18 @@ using ::CompareObjectHandles; + #if defined(BOOST_USE_WINDOWS_H) + BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = DUPLICATE_CLOSE_SOURCE; + BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = DUPLICATE_SAME_ACCESS; +-const HANDLE_ INVALID_HANDLE_VALUE_ = INVALID_HANDLE_VALUE; ++inline const HANDLE_ INVALID_HANDLE_VALUE_ = INVALID_HANDLE_VALUE; + #else + BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = 1; + BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = 2; +-const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1); ++inline const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1); + #endif + + BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE_; + BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS_; + // Note: The "unused" attribute here should not be necessary because the variable is a constant. + // However, MinGW gcc 5.3 spams warnings about this particular constant. +-const HANDLE_ invalid_handle_value BOOST_ATTRIBUTE_UNUSED = INVALID_HANDLE_VALUE_; ++inline const HANDLE_ invalid_handle_value BOOST_ATTRIBUTE_UNUSED = INVALID_HANDLE_VALUE_; + + } + } diff --git a/tests/describe/include_examples.cpp b/tests/describe/include_examples.cpp index e2fc2c33..daad229b 100644 --- a/tests/describe/include_examples.cpp +++ b/tests/describe/include_examples.cpp @@ -382,18 +382,26 @@ TEST_CASE("example: pm_to_string") { ex_out = std::ostringstream(); // fresh state: no flags left by another example int rc = example_main(); CHECK(rc == 0); - CHECK(ex_out.str() == std::string_view(R"ex(&ex_pm_to_string::X::m [int] + const std::string_view expected = +#if !defined(_MSC_VER) || defined(__clang__) + R"ex(&ex_pm_to_string::X::m [int] &ex_pm_to_string::X::f [int() const] &ex_pm_to_string::Y::m [int] &ex_pm_to_string::X::f [int() const] &ex_pm_to_string::Y::g [int() const] &ex_pm_to_string::Z::(unknown) [void()] -)ex" -#if !defined(_MSC_VER) || defined(__clang__) -R"ex(&ex_pm_to_string::pair::second [float] -)ex" +&ex_pm_to_string::pair::second [float] +)ex"; +#else + R"ex(&ex_pm_to_string::X::m [int] +&ex_pm_to_string::X::f [int() const] +&ex_pm_to_string::Y::m [int] +&ex_pm_to_string::X::f [int() const] +&ex_pm_to_string::Y::g [int() const] +&ex_pm_to_string::Z::(unknown) [void()] +)ex"; #endif - )); + CHECK(ex_out.str() == expected); } } // namespace ex_pm_to_string diff --git a/tools/apply_patches.py b/tools/apply_patches.py index 7b19a9dc..ca7b9521 100644 --- a/tools/apply_patches.py +++ b/tools/apply_patches.py @@ -32,7 +32,7 @@ "config_cstdlib", "config_user", "container", "convert", "decimal", "histogram", "hof", "interprocess", "io", "json", "lambda", "math", "move", "mqtt5", "multi_array", "openmethod", "parameter", "range_adaptors", "numeric", "regex", "safe_numerics", "serialization", "sort", "system", "test", "thread", "type_erasure", "ublas", "units", - "unordered", "url", "variant", + "unordered", "url", "variant", "winapi", ] # A vendored file that is an addition, not a patch of an upstream file. diff --git a/tools/export_policy.toml b/tools/export_policy.toml index 30cdabe5..3874f390 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -1592,6 +1592,9 @@ names = [ "boost::interprocess::winapi::win32_find_data_w", "boost::interprocess::winapi::winapi_traits", "boost::interprocess::winapi::write_file", + "boost::interprocess::winapi::hkey_local_machine", + "boost::interprocess::winapi::invalid_handle_value", + "boost::interprocess::winapi::key_query_value", ] [[interprocess.guard]] diff --git a/upstream/boost/boost/interprocess/detail/win32_api.hpp b/upstream/boost/boost/interprocess/detail/win32_api.hpp index e206b58a..21c0cb39 100644 --- a/upstream/boost/boost/interprocess/detail/win32_api.hpp +++ b/upstream/boost/boost/interprocess/detail/win32_api.hpp @@ -598,7 +598,7 @@ static const unsigned long lang_neutral = (unsigned long)0x00; static const unsigned long sublang_default = (unsigned long)0x01; static const unsigned long invalid_file_size = (unsigned long)0xFFFFFFFF; static const unsigned long invalid_file_attributes = ((unsigned long)-1); -static void * const invalid_handle_value = ((void*)(long)(-1)); +inline void * const invalid_handle_value = ((void*)(long)(-1)); static const unsigned long file_type_char = 0x0002L; static const unsigned long file_type_disk = 0x0001L; @@ -625,8 +625,8 @@ const unsigned long max_record_buffer_size = 0x10000L; // 64K const unsigned long max_path = 260; //Keys -static const hkey hkey_local_machine = (hkey)(unsigned long*)(long)(0x80000002); -static unsigned long key_query_value = 0x0001; +inline const hkey hkey_local_machine = (hkey)(unsigned long*)(long)(0x80000002); +BOOST_INLINE_CONSTEXPR unsigned long key_query_value = 0x0001; // Registry types #define reg_none ( 0 ) // No value type diff --git a/upstream/boost/boost/mqtt5/detail/control_packet.hpp b/upstream/boost/boost/mqtt5/detail/control_packet.hpp index 2f0117fe..f775c469 100644 --- a/upstream/boost/boost/mqtt5/detail/control_packet.hpp +++ b/upstream/boost/boost/mqtt5/detail/control_packet.hpp @@ -23,9 +23,9 @@ namespace boost::mqtt5::detail { /* max varint number (268'435'455) + fixed header size (1 + 4) */ -static constexpr int32_t default_max_send_size = 268'435'460; +inline constexpr int32_t default_max_send_size = 268'435'460; -static constexpr int32_t default_max_recv_size = 65'536; +inline constexpr int32_t default_max_recv_size = 65'536; enum class control_code_e : std::uint8_t { no_packet = 0b00000000, // 0 @@ -47,8 +47,8 @@ enum class control_code_e : std::uint8_t { auth = 0b11110000, // 15 }; -constexpr struct with_pid_ {} with_pid {}; -constexpr struct no_pid_ {} no_pid {}; +inline constexpr struct with_pid_ {} with_pid {}; +inline constexpr struct no_pid_ {} no_pid {}; template class control_packet { diff --git a/upstream/boost/boost/mqtt5/detail/topic_validation.hpp b/upstream/boost/boost/mqtt5/detail/topic_validation.hpp index 9de95a7a..88fc2b59 100644 --- a/upstream/boost/boost/mqtt5/detail/topic_validation.hpp +++ b/upstream/boost/boost/mqtt5/detail/topic_validation.hpp @@ -18,7 +18,7 @@ namespace boost::mqtt5::detail { static constexpr int32_t min_subscription_identifier = 1; static constexpr int32_t max_subscription_identifier = 268'435'455; -static constexpr std::string_view shared_sub_prefix = "$share/"; +inline constexpr std::string_view shared_sub_prefix = "$share/"; inline bool is_utf8_no_wildcard(validation_result result) { return result == validation_result::valid; diff --git a/upstream/boost/boost/mqtt5/impl/codecs/base_decoders.hpp b/upstream/boost/boost/mqtt5/impl/codecs/base_decoders.hpp index 6d87ab9e..9778d0b7 100644 --- a/upstream/boost/boost/mqtt5/impl/codecs/base_decoders.hpp +++ b/upstream/boost/boost/mqtt5/impl/codecs/base_decoders.hpp @@ -345,7 +345,7 @@ struct prop_parser { }; template -constexpr auto props_ = prop_parser {}; +inline constexpr auto props_ = prop_parser {}; } // end namespace prop diff --git a/upstream/boost/boost/mqtt5/impl/codecs/base_encoders.hpp b/upstream/boost/boost/mqtt5/impl/codecs/base_encoders.hpp index e5359d9d..669ac0fd 100644 --- a/upstream/boost/boost/mqtt5/impl/codecs/base_encoders.hpp +++ b/upstream/boost/boost/mqtt5/impl/codecs/base_encoders.hpp @@ -192,10 +192,10 @@ class int_def { } }; -constexpr auto byte_ = int_def {}; -constexpr auto int16_ = int_def {}; -constexpr auto int32_ = int_def {}; -constexpr auto varlen_ = int_def {}; +inline constexpr auto byte_ = int_def {}; +inline constexpr auto int16_ = int_def {}; +inline constexpr auto int32_ = int_def {}; +inline constexpr auto varlen_ = int_def {}; template @@ -286,9 +286,9 @@ class array_def { using utf8_def = array_def; -constexpr auto utf8_ = utf8_def {}; -constexpr auto binary_ = array_def {}; // for now -constexpr auto verbatim_ = array_def {}; +inline constexpr auto utf8_ = utf8_def {}; +inline constexpr auto binary_ = array_def {}; // for now +inline constexpr auto verbatim_ = array_def {}; template @@ -504,8 +504,8 @@ class props_def { } }; -constexpr auto props_ = props_def {}; -constexpr auto props_may_omit_ = props_def {}; +inline constexpr auto props_ = props_def {}; +inline constexpr auto props_may_omit_ = props_def {}; } // end namespace prop diff --git a/upstream/boost/boost/mqtt5/reason_codes.hpp b/upstream/boost/boost/mqtt5/reason_codes.hpp index 2cde5e8a..ad5fe9c8 100644 --- a/upstream/boost/boost/mqtt5/reason_codes.hpp +++ b/upstream/boost/boost/mqtt5/reason_codes.hpp @@ -205,150 +205,150 @@ class reason_code { namespace reason_codes { /** \brief No Reason Code. A \ref client::error occurred.*/ -constexpr reason_code empty {}; +inline constexpr reason_code empty {}; /** \brief The operation completed successfully. */ -constexpr reason_code success { 0x00 }; +inline constexpr reason_code success { 0x00 }; /** \brief Close the connection normally. Do not send the Will Message. */ -constexpr reason_code normal_disconnection { 0x00, category::disconnect }; +inline constexpr reason_code normal_disconnection { 0x00, category::disconnect }; /** \brief The subscription is accepted with maximum QoS sent at 0. */ -constexpr reason_code granted_qos_0 { 0x00, category::suback }; +inline constexpr reason_code granted_qos_0 { 0x00, category::suback }; /** \brief The subscription is accepted with maximum QoS sent at 1. */ -constexpr reason_code granted_qos_1 { 0x01 }; +inline constexpr reason_code granted_qos_1 { 0x01 }; /** \brief The subscription is accepted with maximum QoS sent at 2 */ -constexpr reason_code granted_qos_2 { 0x02 }; +inline constexpr reason_code granted_qos_2 { 0x02 }; /** \brief The Client wishes to disconnect but requires that the Server also publishes its Will Message. */ -constexpr reason_code disconnect_with_will_message { 0x04 }; +inline constexpr reason_code disconnect_with_will_message { 0x04 }; /** \brief The message is accepted but there are no subscribers. */ -constexpr reason_code no_matching_subscribers { 0x10 }; +inline constexpr reason_code no_matching_subscribers { 0x10 }; /** \brief No matching Topic Filter is being used by the Client. */ -constexpr reason_code no_subscription_existed { 0x11 }; +inline constexpr reason_code no_subscription_existed { 0x11 }; /** \brief Continue the authentication with another step. */ -constexpr reason_code continue_authentication { 0x18 }; +inline constexpr reason_code continue_authentication { 0x18 }; /** \brief Initiate a re-authentication. */ -constexpr reason_code reauthenticate { 0x19 }; +inline constexpr reason_code reauthenticate { 0x19 }; /** \brief The Server does not wish to reveal the reason for the failure or none of the other Reason Codes apply. */ -constexpr reason_code unspecified_error { 0x80 }; +inline constexpr reason_code unspecified_error { 0x80 }; /** \brief Data within the packet could not be correctly parsed. */ -constexpr reason_code malformed_packet { 0x81 }; +inline constexpr reason_code malformed_packet { 0x81 }; /** \brief Data in the packet does not conform to this specification. */ -constexpr reason_code protocol_error { 0x82 }; +inline constexpr reason_code protocol_error { 0x82 }; /** \brief The packet is valid but not accepted by this Server. */ -constexpr reason_code implementation_specific_error { 0x83 }; +inline constexpr reason_code implementation_specific_error { 0x83 }; /** \brief The Server does not support the requested version of the MQTT protocol. */ -constexpr reason_code unsupported_protocol_version { 0x84 }; +inline constexpr reason_code unsupported_protocol_version { 0x84 }; /** \brief The Client ID is valid but not allowed by this Server. */ -constexpr reason_code client_identifier_not_valid { 0x85 }; +inline constexpr reason_code client_identifier_not_valid { 0x85 }; /** \brief The Server does not accept the User Name or Password provided. */ -constexpr reason_code bad_username_or_password { 0x86 }; +inline constexpr reason_code bad_username_or_password { 0x86 }; /** \brief The request is not authorized. */ -constexpr reason_code not_authorized { 0x87 }; +inline constexpr reason_code not_authorized { 0x87 }; /** \brief The MQTT Server is not available. */ -constexpr reason_code server_unavailable { 0x88 }; +inline constexpr reason_code server_unavailable { 0x88 }; /** \brief The MQTT Server is busy, try again later. */ -constexpr reason_code server_busy { 0x89 }; +inline constexpr reason_code server_busy { 0x89 }; /** \brief The Client has been banned by administrative action. */ -constexpr reason_code banned { 0x8a }; +inline constexpr reason_code banned { 0x8a }; /** \brief The Server is shutting down. */ -constexpr reason_code server_shutting_down { 0x8b }; +inline constexpr reason_code server_shutting_down { 0x8b }; /** \brief The authentication method is not supported or does not match the method currently in use. */ -constexpr reason_code bad_authentication_method { 0x8c }; +inline constexpr reason_code bad_authentication_method { 0x8c }; /** \brief No packet has been received for 1.5 times the Keepalive time. */ -constexpr reason_code keep_alive_timeout { 0x8d }; +inline constexpr reason_code keep_alive_timeout { 0x8d }; /** \brief Another Connection using the same ClientID has connected causing this Connection to be closed. */ -constexpr reason_code session_taken_over { 0x8e }; +inline constexpr reason_code session_taken_over { 0x8e }; /** \brief The Topic Filter is not malformed, but it is not accepted. */ -constexpr reason_code topic_filter_invalid { 0x8f }; +inline constexpr reason_code topic_filter_invalid { 0x8f }; /** \brief The Topic Name is not malformed, but it is not accepted. */ -constexpr reason_code topic_name_invalid { 0x90 }; +inline constexpr reason_code topic_name_invalid { 0x90 }; /** \brief The Packet Identifier is already in use. */ -constexpr reason_code packet_identifier_in_use { 0x91 }; +inline constexpr reason_code packet_identifier_in_use { 0x91 }; /** \brief The Packet Identifier is not known. */ -constexpr reason_code packet_identifier_not_found { 0x92 }; +inline constexpr reason_code packet_identifier_not_found { 0x92 }; /** \brief The Client or Server has received more than the Receive Maximum publication for which it has not sent PUBACK or PUBCOMP. */ -constexpr reason_code receive_maximum_exceeded { 0x93 }; +inline constexpr reason_code receive_maximum_exceeded { 0x93 }; /** \brief The Client or Server received a PUBLISH packet containing a Topic Alias greater than the Maximum Topic Alias. */ -constexpr reason_code topic_alias_invalid { 0x94 }; +inline constexpr reason_code topic_alias_invalid { 0x94 }; /** \brief The packet exceeded the maximum permissible size. */ -constexpr reason_code packet_too_large { 0x95 }; +inline constexpr reason_code packet_too_large { 0x95 }; /** \brief The received data rate is too high. */ -constexpr reason_code message_rate_too_high { 0x96 }; +inline constexpr reason_code message_rate_too_high { 0x96 }; /** \brief An implementation or administrative imposed limit has been exceeded. */ -constexpr reason_code quota_exceeded { 0x97 }; +inline constexpr reason_code quota_exceeded { 0x97 }; /** \brief The Connection is closed due to an administrative action. */ -constexpr reason_code administrative_action { 0x98 }; +inline constexpr reason_code administrative_action { 0x98 }; /** \brief The Payload does not match the specified Payload Format Indicator. */ -constexpr reason_code payload_format_invalid { 0x99 }; +inline constexpr reason_code payload_format_invalid { 0x99 }; /** \brief The Server does not support retained messages. */ -constexpr reason_code retain_not_supported { 0x9a }; +inline constexpr reason_code retain_not_supported { 0x9a }; /** \brief The Server does not support the QoS the Client specified or it is greater than the Maximum QoS specified. */ -constexpr reason_code qos_not_supported { 0x9b }; +inline constexpr reason_code qos_not_supported { 0x9b }; /** \brief The Client should temporarily use another server. */ -constexpr reason_code use_another_server { 0x9c }; +inline constexpr reason_code use_another_server { 0x9c }; /** \brief The Client should permanently use another server. */ -constexpr reason_code server_moved { 0x9d }; +inline constexpr reason_code server_moved { 0x9d }; /** \brief The Server does not support Shared Subscriptions for this Client. */ -constexpr reason_code shared_subscriptions_not_supported { 0x9e }; +inline constexpr reason_code shared_subscriptions_not_supported { 0x9e }; /** \brief The connection rate limit has been exceeded. */ -constexpr reason_code connection_rate_exceeded { 0x9f }; +inline constexpr reason_code connection_rate_exceeded { 0x9f }; /** \brief The maximum connection time authorized for this connection has been exceeded. */ -constexpr reason_code maximum_connect_time { 0xa0 }; +inline constexpr reason_code maximum_connect_time { 0xa0 }; /** \brief The Server does not support Subscription Identifiers. */ -constexpr reason_code subscription_ids_not_supported { 0xa1 }; +inline constexpr reason_code subscription_ids_not_supported { 0xa1 }; /** \brief The Server does not support Wildcard Subscriptions. */ -constexpr reason_code wildcard_subscriptions_not_supported { 0xa2 }; +inline constexpr reason_code wildcard_subscriptions_not_supported { 0xa2 }; namespace detail { diff --git a/upstream/boost/boost/url/detail/encode.hpp b/upstream/boost/boost/url/detail/encode.hpp index c16890a7..e38d76ef 100644 --- a/upstream/boost/boost/url/detail/encode.hpp +++ b/upstream/boost/boost/url/detail/encode.hpp @@ -21,7 +21,6 @@ namespace boost { namespace urls { namespace detail { -constexpr BOOST_INLINE_CONSTEXPR char const* const hexdigs[] = { "0123456789ABCDEF", "0123456789abcdef" }; diff --git a/upstream/boost/boost/url/grammar/range_rule.hpp b/upstream/boost/boost/url/grammar/range_rule.hpp index 631fb435..97fa9fec 100644 --- a/upstream/boost/boost/url/grammar/range_rule.hpp +++ b/upstream/boost/boost/url/grammar/range_rule.hpp @@ -85,6 +85,13 @@ using is_range_rule = implementation_defined::is_range_rule< RangeRule>::type>; #ifdef BOOST_URL_HAS_CONCEPTS +#if defined(BOOST_MSVC) +// MSVC's C++20 module IFC serializer drops `const` from `char const*&` in a +// concept requires-parameter list, making RangeRule evaluate to false for +// imported rules. Delegate to is_range_rule. +template +concept RangeRule = is_range_rule::value; +#else template concept RangeRule = requires (T r, char const*& it, char const* end) @@ -94,6 +101,7 @@ concept RangeRule = { r.next(it, end) } -> std::same_as>; }; #endif +#endif template class any_rule; diff --git a/upstream/boost/boost/winapi/handles.hpp b/upstream/boost/boost/winapi/handles.hpp index 328d3242..81e83095 100644 --- a/upstream/boost/boost/winapi/handles.hpp +++ b/upstream/boost/boost/winapi/handles.hpp @@ -60,18 +60,18 @@ using ::CompareObjectHandles; #if defined(BOOST_USE_WINDOWS_H) BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = DUPLICATE_CLOSE_SOURCE; BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = DUPLICATE_SAME_ACCESS; -const HANDLE_ INVALID_HANDLE_VALUE_ = INVALID_HANDLE_VALUE; +inline const HANDLE_ INVALID_HANDLE_VALUE_ = INVALID_HANDLE_VALUE; #else BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = 1; BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = 2; -const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1); +inline const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1); #endif BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE_; BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS_; // Note: The "unused" attribute here should not be necessary because the variable is a constant. // However, MinGW gcc 5.3 spams warnings about this particular constant. -const HANDLE_ invalid_handle_value BOOST_ATTRIBUTE_UNUSED = INVALID_HANDLE_VALUE_; +inline const HANDLE_ invalid_handle_value BOOST_ATTRIBUTE_UNUSED = INVALID_HANDLE_VALUE_; } } From 2af335f5015ee5b6db6d278bfa9e7deb5b285adf Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 10:16:52 +0000 Subject: [PATCH 18/21] fix(beast,mcpp): sequence advanced_server HTTP/WS requests, restore Windows -l* ldflags for clang++, and update patches/README --- mcpp.toml | 9 ++++-- patches/README.md | 48 ++++++++++++++++++++---------- tests/beast/examples_websocket.cpp | 4 ++- 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/mcpp.toml b/mcpp.toml index c92ae775..bf6472ce 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -309,9 +309,11 @@ cxxflags = ["-Wno-invalid-specialization"] # Boost headers that test __cplusplus (e.g. hana/traits.hpp) to take C++98 # branches and reference traits removed in C++20 (such as std::is_literal_type). # Heavy template test TUs (geometry, math) exceed COFF's 65535-section limit -# without /bigobj. +# without /bigobj. link.exe takes foo.lib rather than -lfoo (it ignores -lfoo +# from [target.windows.build] with LNK4044). [target.'cfg(compiler = "msvc")'.build] cxxflags = ["/Zc:__cplusplus", "/bigobj"] +ldflags = ["ws2_32.lib", "ntdll.lib", "shell32.lib", "advapi32.lib", "secur32.lib", "user32.lib", "synchronization.lib"] # -- generated by tools/gen_features.py - do not edit -- [features] @@ -687,8 +689,9 @@ sources = [ ] # System libraries the Windows TUs need, mirroring upstream's WIN32 link set # (cobalt/process sockets and process info, log's object_name, atomic's -# WaitOnAddress). Both link.exe (MSVC) and clang-cl/lld-link accept *.lib. -ldflags = ["ws2_32.lib", "ntdll.lib", "shell32.lib", "advapi32.lib", "secur32.lib", "user32.lib", "synchronization.lib"] +# WaitOnAddress). clang++ on Windows takes -lfoo; native MSVC also passes +# *.lib in [target.'cfg(compiler = "msvc")'.build]. +ldflags = ["-lws2_32", "-lntdll", "-lshell32", "-ladvapi32", "-lsecur32", "-luser32", "-lsynchronization"] [target.unix.build] sources = [ diff --git a/patches/README.md b/patches/README.md index 62475bf2..53c009ef 100644 --- a/patches/README.md +++ b/patches/README.md @@ -131,24 +131,40 @@ upstream's direct-CRTP fallback without affecting GCC or Clang (`clang-cl` does not define `BOOST_MSVC`); the 13 helper symbols declared only under that macro are guarded in `tools/export_policy.toml`. -`bloom.patch`, `sort.patch`, `unordered.patch`, and the MSVC-module additions to -`accumulators.patch`, `interprocess.patch`, and `serialization.patch` promote -internal-linkage `static inline` functions (`mm_testc_si128`, `nbits32`, -`nbits64`, `get_singleton_module`), `static const` defaults -(`default_bucket_count`, `default_map_options`), and anonymous-namespace -references (`boost::numeric::{min_assign,max_assign,fdiv,average,as_min,as_max,as_zero,as_one}`) -to `inline` / `BOOST_INLINE_CONSTEXPR` so native MSVC C++20 modules can emit -and reference them from imported templates (`C2129` / `C7631` / `C2039` / `C2065`). +`bloom.patch`, `charconv.patch`, `decimal.patch`, `histogram.patch`, +`move.patch`, `sort.patch`, `unordered.patch`, `winapi.patch`, and the +MSVC-module additions to `accumulators.patch`, `interprocess.patch`, +`json.patch`, `math.patch`, `mqtt5.patch`, `serialization.patch`, +`system.patch`, and `url.patch` promote internal-linkage `static inline` +functions (`mm_testc_si128`, `nbits32`, `nbits64`, `get_singleton_module`), +internal-linkage namespace-scope `constexpr`/`static const` tables and tags +(`default_bucket_count`, `default_map_options`, `default_location`, +`INVALID_HANDLE_VALUE_`, `invalid_handle_value`, `hkey_local_machine`, +`key_query_value`, `AdaptiveSortInsertionSortThreshold`, `tmsb`, +`literal_strings`/`literal_sizes`, `lambert_w_lookup::*`, `charconv` / +`decimal` / `int128` lookup tables, `histogram::axis::option::*`, `mqtt5` +reason codes / encoder defs, and `url` detail charsets / rules), and +`BOOST_MSVC`-guarded anonymous-namespace references in +`boost/accumulators/numeric/functional*.hpp` to `inline` / +`BOOST_INLINE_CONSTEXPR` so native MSVC C++20 modules can emit, initialize, and +link them from imported templates (`C2129` / `C7631` / `C2039` / `C2065` / +`LNK2001`). `openmethod.patch` passes `std::decay_t` to `override_aux` in `boost/openmethod/core.hpp` so MSVC 14.52 matches the function-pointer partial specialization. -`asio.patch` and `url.patch` also work around two native MSVC 14.52 C++20 -module IFC bugs: `friend` declarations on GMF classes are not preserved across -IFC import (breaking `private:` `query`/`require` on Asio executors and -`private:` destructors on `url_view_base`/`url_base`/`static_url_base`, so the -former stay `public:` under `BOOST_ASIO_MSVC` and the latter become -`protected:`), and MSVC's IFC serializer drops `const` from `char const*&` in -`boost::urls::grammar::Rule`'s `requires` parameter list (delegated to -`is_rule::value` under `BOOST_MSVC`). +`asio.patch` and `url.patch` also work around native MSVC 14.52 C++20 module +IFC bugs: `friend` declarations on GMF classes are not preserved across IFC +import (breaking `private:` `query`/`require` on Asio executors and `private:` +constructors/destructors on `url_view_base`/`url_base`/`static_url_base`, so +the former stay `public:` under `BOOST_ASIO_MSVC` and the latter become +`protected:`), Asio's `proxy`/`static_proxy` SFINAE wrappers in `require.hpp`, +`query.hpp`, `prefer.hpp`, `require_concept.hpp`, and `execution/*.hpp` fail +expression SFINAE after IFC import (so `BOOST_ASIO_MSVC` takes upstream's +`typedef T type;` fallback), `url_view_base::shared_impl` inheriting from +`url_view` causes a circular IFC deserialization (`C2504`, resolved by moving +it to `detail::url_view_shared_impl`), and MSVC's IFC serializer drops `const` +from `char const*&` in `boost::urls::grammar::Rule` and `RangeRule` `requires` +parameter lists (delegated to `is_rule::value` / `is_range_rule::value` +under `BOOST_MSVC`). diff --git a/tests/beast/examples_websocket.cpp b/tests/beast/examples_websocket.cpp index 3106609b..016bdc96 100644 --- a/tests/beast/examples_websocket.cpp +++ b/tests/beast/examples_websocket.cpp @@ -3740,7 +3740,9 @@ TEST_CASE("example: advanced/server/advanced_server") { ex_argv_store.push_back(nullptr); ex_argv = ex_argv_store.data(); ex_argc = int(ex_args.size()); - int rc = (ex_serve_async([a = ex_args] { (void)ex_call_main(&example_main, a); }, ex_port), (ex_http_get(ex_port, "/index.html") + ex_ws_exchange(ex_port, "hello beast"))); + ex_serve_async([a = ex_args] { (void)ex_call_main(&example_main, a); }, ex_port); + int rc = ex_http_get(ex_port, "/index.html"); + rc += ex_ws_exchange(ex_port, "hello beast"); CHECK(rc == 0); CHECK(ex_out.str() == std::string_view(R"ex(received: 200 OK Content-Type: text/html From fb38dbdbc1d0ad1be4c72e3d43075d8f8408910d Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 10:59:30 +0000 Subject: [PATCH 19/21] fix(serialization): gate BOOST_DLLEXPORT on DYN_LINK for native MSVC so tests/dll auto-exports --- patches/README.md | 5 +++-- patches/serialization.patch | 13 ++++++++----- .../boost/boost/serialization/force_include.hpp | 11 +++++++---- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/patches/README.md b/patches/README.md index 53c009ef..bc5b5b86 100644 --- a/patches/README.md +++ b/patches/README.md @@ -106,8 +106,9 @@ in every build, now only under `BOOST_SERIALIZATION_DYN_LINK` / `BOOST_ALL_DYN_LINK`; and `BOOST_DLLEXPORT` in `boost/serialization/force_include.hpp`, which keeps registration code from being dropped. On clang for Windows it is now empty and `BOOST_USED` is -`__attribute__((used))`, which is what ELF builds already use. cl keeps -`dllexport`. +`__attribute__((used))`, which is what ELF builds already use; cl also leaves +it empty unless `BOOST_SERIALIZATION_DYN_LINK` / `BOOST_ALL_DYN_LINK` is +defined. Every patch is reviewed against the 1.92.0 tag it was written for; `upstream/boost/SOURCE.md` records the archive and checksum the tree comes diff --git a/patches/serialization.patch b/patches/serialization.patch index c01adfbe..5bd5ed47 100644 --- a/patches/serialization.patch +++ b/patches/serialization.patch @@ -112,16 +112,19 @@ diff --git a/upstream/boost/boost/serialization/force_include.hpp b/upstream/boo index 022279d1..4cc81a99 100644 --- a/upstream/boost/boost/serialization/force_include.hpp +++ b/upstream/boost/boost/serialization/force_include.hpp -@@ -30,8 +30,14 @@ +@@ -30,8 +30,17 @@ // in an ungraceful crash at runtime when (and only when) built in // release mode. -#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__) +// boost-m vendored edit: clang on Windows keeps the code with `used`, as it -+// does on ELF. A `dllexport` here lands in every object that instantiates a -+// serializer, and a DLL with any declared export gets no discovered ones -+// (lld-link with a generated .def, GNU ld's auto-export alike). -+#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__) && !defined(__clang__) ++// does on ELF, and cl only emits `dllexport` under BOOST_ALL_DYN_LINK / ++// BOOST_SERIALIZATION_DYN_LINK (mirroring codecvt_null.hpp). A `dllexport` ++// here lands in every object that instantiates a serializer, and a DLL with ++// any declared export gets no discovered ones (link.exe / lld-link with a ++// generated .def, GNU ld's auto-export alike). ++#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__) && !defined(__clang__) \ ++ && (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)) # define BOOST_DLLEXPORT __declspec(dllexport) +#elif defined(__clang__) && (defined(_WIN32) || defined(_WIN64)) +# define BOOST_USED __attribute__ ((__used__)) diff --git a/upstream/boost/boost/serialization/force_include.hpp b/upstream/boost/boost/serialization/force_include.hpp index 4cc81a99..e9d12f4a 100644 --- a/upstream/boost/boost/serialization/force_include.hpp +++ b/upstream/boost/boost/serialization/force_include.hpp @@ -31,10 +31,13 @@ // release mode. // boost-m vendored edit: clang on Windows keeps the code with `used`, as it -// does on ELF. A `dllexport` here lands in every object that instantiates a -// serializer, and a DLL with any declared export gets no discovered ones -// (lld-link with a generated .def, GNU ld's auto-export alike). -#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__) && !defined(__clang__) +// does on ELF, and cl only emits `dllexport` under BOOST_ALL_DYN_LINK / +// BOOST_SERIALIZATION_DYN_LINK (mirroring codecvt_null.hpp). A `dllexport` +// here lands in every object that instantiates a serializer, and a DLL with +// any declared export gets no discovered ones (link.exe / lld-link with a +// generated .def, GNU ld's auto-export alike). +#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__) && !defined(__clang__) \ + && (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)) # define BOOST_DLLEXPORT __declspec(dllexport) #elif defined(__clang__) && (defined(_WIN32) || defined(_WIN64)) # define BOOST_USED __attribute__ ((__used__)) From 817035cc3153cf096a94fbe129518e452a696702 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 11:56:36 +0000 Subject: [PATCH 20/21] ci(examples): skip git-dep on msvc@system for pre-MSVC tag mwrap-1.92.0 --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bd1f1944..2efe64ea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -408,6 +408,10 @@ jobs: set -euo pipefail tag="$(sed -n 's/.*tag = "\([^"]*\)".*/\1/p' git-dep/mcpp.toml | head -n1)" test -n "$tag" + if [ "${{ matrix.toolchain }}" = "msvc@system" ] && [ "$tag" = "mwrap-1.92.0" ]; then + echo "::notice title=git-dep example skipped::published tag $tag predates native MSVC support" + exit 0 + fi set +e git ls-remote --exit-code --tags \ https://github.com/mcpplibs/boost-m.git "refs/tags/$tag" >/dev/null 2>&1 From ac2c258d6874af60a4b57b777c6a80591659be35 Mon Sep 17 00:00:00 2001 From: Zhe Feng Date: Sat, 5 Dec 2026 13:17:46 +0000 Subject: [PATCH 21/21] docs: finalize Windows MSVC CI adaptation design record --- ...2-04-windows-msvc-ci-adaptations-design.md | 39 +++++++++++++++---- .agents/docs/README.md | 5 +-- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md b/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md index fc5de78d..58d1a31f 100644 --- a/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md +++ b/.agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md @@ -1,6 +1,6 @@ --- subject: ci -status: active +status: landed --- # Windows 原生 MSVC(`msvc@system`)CI 适配记录 @@ -154,8 +154,7 @@ Windows SDK 10.0.26100.0)。 全部 120 个库模块编译通过后,测试套件在原生 MSVC 暴露出 6 类问题并已一并修复: 1. **链接参数与 `/bigobj`(`mcpp.toml`)**: - - `link.exe` 不接受 `-lws2_32` 等 GNU 风格参数(`LNK4044` 导致全部测试链接失败 `LNK2019`); - 将 Windows 链接参数按 `compiler = "msvc"`(使用 `*.lib`)与 `not(compiler = "msvc")`(保留 `-l*`)拆分。 + - `link.exe` 不接受 `-lws2_32` 等 GNU 风格参数(`LNK4044` 导致链接失败 `LNK2019`),而 `windows-llvm-msvc` 的 `clang++` 驱动仍需 `-l*`。最终在 `[target.windows.build]` 保留 `-l*`,并在 `[target.'cfg(compiler = "msvc")'.build]` 追加 `*.lib`(`link.exe` 忽略 `-l*` 后正常链接)。 - 重模板测试(`tests/geometry/examples_algorithms.cpp`、`tests/math/examples_1.cpp`)超 COFF 节数上限(`C1128`),在 `[target.'cfg(compiler = "msvc")'.build].cxxflags` 补充 `/bigobj`。 2. **内部链接函数/常量提升(`bloom`、`sort`、`unordered`、`interprocess`、`serialization`、`accumulators` 补丁)**: - 原生 MSVC C++20 模块要求被导出模板引用的辅助函数/常量具备外部链接,否则报 `C2129` / `C7631` / `C2039` / `C2065`。 @@ -172,11 +171,35 @@ Windows SDK 10.0.26100.0)。 - `patches/openmethod.patch` 在 `boost/openmethod/core.hpp` 使用 `std::decay_t` 以在 MSVC 14.52 匹配函数指针偏特化。 - `tests/statechart.cpp` 将 `#include ` 移至 `import` 之前,消除默认模板实参重定义(`C2572`)。 -## 待跟进事项 - -1. **全量 CI 测试与示例验证**:等待 `group A` / `group B` 全部模块编译与测试运行通过, - 继续排查可能出现的链接/运行期问题,并验证 `examples` job;全部落地前补充更新 - `patches/README.md` 对 `math.patch` 新增改动的说明,并将本记录状态置为 `landed`。 +### 8. 全量测试收尾、子项目与示例适配(`55e9a905` → `817035cc`) + +1. **Asio `proxy`/`static_proxy` SFINAE 绕过(`patches/asio.patch`,修复全部 21 个 asio/beast/cobalt/mqtt5 测试)**: + - 仅开放执行器 `require`/`query` 为 `public:` 后,`require_member::is_valid` 已为 `1`,但 `can_require`、`can_query` 与 `is_convertible` 仍为 `0`。 + - 经 MSVC 探针定位:`require.hpp`、`query.hpp`、`prefer.hpp`、`require_concept.hpp` 及 `execution/*.hpp` 中的嵌套 `proxy::type` / `static_proxy::type` 包装结构体在 `.ifc` 反序列化后触发表达式 SFINAE 失效。 + - **决策**:在 `BOOST_ASIO_MSVC` 下跳过 `proxy`/`static_proxy` 包装,走上游已有的 `typedef T type;` 分支(与 `public:` 成员配合语义等价)。 +2. **命名空间作用域非 `inline` `constexpr`/`static const` 提升(修复 33 个 `LNK2001` 与 `rtree/interprocess` 运行时异常)**: + - 原生 MSVC C++20 模块中,导入模板若引用 GMF 头文件里具有内部链接的命名空间常量或查表数组,消费者 `.obj` 会生成外部符号引用导致 `LNK2001`;动态初始化的 `static` 变量在消费者侧甚至未初始化(导致 `interprocess` 的 `RegOpenKeyEx(hkey_local_machine, ...)` 失败并抛 `library_error`)。 + - **决策**:统一提升为 `inline` / `BOOST_INLINE_CONSTEXPR`(`winapi/handles.hpp` 与 `win32_api.hpp` 的指针句柄常量用 `inline const`),并同步更新 `tools/apply_patches.py`、`tools/export_policy.toml`(为 `boost::interprocess::winapi::{hkey_local_machine,invalid_handle_value,key_query_value}` 补齐 `defined(_WIN32)` 守卫)与 `generated/exports/*.inc`: + - 新增补丁:`patches/charconv.patch`、`patches/decimal.patch`(含 `int128` 的 `BOOST_DECIMAL_DETAIL_INT128_INLINE_CONSTEXPR`)、`patches/histogram.patch`、`patches/move.patch`、`patches/winapi.patch`。 + - 补充已有补丁:`patches/system.patch`(`default_location`)、`patches/json.patch`(`literal_strings`/`literal_sizes`)、`patches/math.patch`(`lambert_w_lookup::*`)、`patches/mqtt5.patch`(`reason_codes::*`、encoder 定义与 `detail::*`)、`patches/sort.patch`(`tmsb`)、`patches/url.patch`(`detail::*` 字符集与规则,修正 `encode.hpp` 重复 `constexpr`)、`patches/interprocess.patch`(`win32_api.hpp` 三个动态初始化 `static` 变量)。 +3. **URL 循环 IFC 反序列化与 `RangeRule` 概念(`patches/url.patch`,修复 4 个 url 测试)**: + - 将 `url_view_base` 的构造函数与成员数据设为 `protected:`,修复 `url::url()` 被判为 deleted(`C2280`)。 + - `url_view_base::shared_impl` 继承自 `url_view`(而 `url_view` 又继承自 `url_view_base`),导致 MSVC IFC 反序列化 `result` 时报 `C2504: 'boost::urls::url_view': base class undefined`;将其移出为非嵌套的 `detail::url_view_shared_impl`。 + - `boost::urls::grammar::RangeRule` 存在与 `Rule` 相同的 `char const*&` 丢 `const` 问题,在 `BOOST_MSVC` 下委托给 `is_range_rule::value`。 +4. **Accumulators 守卫收窄(`patches/accumulators.patch`,修复 GCC 16.1 ICE 与 MSVC `C7631`)**: + - 此前无条件将 `functional.hpp`/`functional_fwd.hpp` 中的单例引用改为 `extern` + `inline` 触发了 GCC 16.1 段错误 ICE;改为仅在 `#if defined(BOOST_MSVC)` 下使用 `inline` 引用(覆盖全部一元、二元及尾部算子宏),GCC/Clang 保持原匿名命名空间。 +5. **Serialization `BOOST_DLLEXPORT` 与 `tests/dll` 子项目(`patches/serialization.patch`)**: + - `tests/dll` 构建共享 `boost.dll` 时,此前 `force_include.hpp` 仅在 Clang 上清空了 `BOOST_DLLEXPORT`,导致原生 `cl.exe` 仍在静态构建的 serialization 对象中发射 `__declspec(dllexport)`,从而令 `mcpp` 跳过自动导出 `.def`,`boost::filesystem::*` 全部未导出(`LNK2019`)。 + - **决策**:参照 `codecvt_null.hpp`,将原生 MSVC 的 `BOOST_DLLEXPORT` 限定在 `defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)` 下。 +6. **测试与示例工作流适配**: + - `tests/describe/include_examples.cpp`:在原生 MSVC 下对齐 `pm_to_string` 跳过 `pair::second` 的预期输出(并将 `#if` 移出 `CHECK(...)` 宏参数)。 + - `tests/test/included/example/test_case_template_example.cpp`:在 `ex_harness::normalize` 中将 MSVC 的 `boost__mpl__integral_c` 归一化为 `mpl___integral_c`。 + - `tests/beast/examples_websocket.cpp`:将 `advanced_server` 中 `ex_http_get(...) + ex_ws_exchange(...)` 拆分为顺序语句,消除 MSVC 右到左求值顺序导致的输出顺序反转。 + - `.github/workflows/tests.yml`:`examples` 任务的 `git-dep` 步骤在 `toolchain == msvc@system` 且目标标签为早于 MSVC 适配的 `mwrap-1.92.0` 时跳过(后续发布新标签后将自动启用)。 + +## 验收结果 + +- PR #16(commit `817035cc`)全部 **23 / 23 项 CI 检查通过**(6 个宿主平台的 Group A/B 库构建与全量 417 个测试、`tests/dll` 与 `tests/test/utf` 子项目、6 平台 `examples` 与模板烟雾测试、`Verify Generation Scripts`、`Check Documents`、`example coverage`)。 ## 本地验证 diff --git a/.agents/docs/README.md b/.agents/docs/README.md index 2f36bb5e..614b182b 100644 --- a/.agents/docs/README.md +++ b/.agents/docs/README.md @@ -31,7 +31,6 @@ ## 进行中 -- [Windows 原生 MSVC(`msvc@system`)CI 适配记录](2026-12-04-windows-msvc-ci-adaptations-design.md) — active - [PR #5 第二轮评审的 [nit] 修复:覆盖率按测试程序列出的用例核对](2026-11-21-pr5-review-nits-design.md) — active - [子工程复用根工程的构建产物,mcpp 升级到 2026.11.20.1](2026-11-20-sub-project-build-reuse-design.md) — active - [模块测试加固的发现复盘:封装层缺陷与上游 Boost 问题(对照 1.93.0.beta1)](2026-11-12-module-tests-findings-and-upstream-bugs-analysis.md) — active @@ -42,7 +41,7 @@ ### ci -- [Windows 原生 MSVC(`msvc@system`)CI 适配记录](2026-12-04-windows-msvc-ci-adaptations-design.md) — active +- [Windows 原生 MSVC(`msvc@system`)CI 适配记录](2026-12-04-windows-msvc-ci-adaptations-design.md) — landed ### docs @@ -71,7 +70,7 @@ ### 2026-12 -- [Windows 原生 MSVC(`msvc@system`)CI 适配记录](2026-12-04-windows-msvc-ci-adaptations-design.md) — active +- [Windows 原生 MSVC(`msvc@system`)CI 适配记录](2026-12-04-windows-msvc-ci-adaptations-design.md) — landed ### 2026-11