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 000000000..9fbbe1097 --- /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 b8669b622..2f36bb5eb 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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4cbd5a846..bd1f19444 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 diff --git a/generated/exports/algorithm.inc b/generated/exports/algorithm.inc index 235cb52d1..d83386d1a 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/concept_check.inc b/generated/exports/concept_check.inc index dec11d721..b0fb079f4 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/exports/hana.inc b/generated/exports/hana.inc index 3e0afe023..ddd6846de 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/exports/math.inc b/generated/exports/math.inc index 47d094145..044036b77 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/exports/type_traits.inc b/generated/exports/type_traits.inc index 056ffa4e3..5de74d495 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/units.inc b/generated/exports/units.inc index e516ae192..ce8254964 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/exports/variant.inc b/generated/exports/variant.inc index 761d5510f..1bf241ea7 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 11395376a..72c4556d6 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. @@ -112,6 +114,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. @@ -240,6 +256,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. @@ -508,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. @@ -807,6 +834,15 @@ 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 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. @@ -833,6 +869,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/mcpp.toml b/mcpp.toml index 5a37ffd23..040d09b23 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/patches/math.patch b/patches/math.patch index 0fe17cc27..d1bfdb298 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/src/hana.cppm b/src/hana.cppm index bb953f29f..c68c934ce 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 ca73b7dcc..ec98c7f05 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 @@ -856,6 +871,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 @@ -1170,6 +1239,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 @@ -1594,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 = ''' @@ -2619,6 +2722,83 @@ 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", +] + +# -------------------------------------------------------------------------- +# 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 @@ -2701,6 +2881,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) diff --git a/upstream/boost/boost/math/differentiation/finite_difference.hpp b/upstream/boost/boost/math/differentiation/finite_difference.hpp index 1375bac7a..b2fc9ea81 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 4103f538d..a21c299f5 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 c285b479f..3cb1fa607 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;