diff --git a/.agents/docs/2026-11-29-reachable-exports-design.md b/.agents/docs/2026-11-29-reachable-exports-design.md new file mode 100644 index 00000000..2ff8cad2 --- /dev/null +++ b/.agents/docs/2026-11-29-reachable-exports-design.md @@ -0,0 +1,123 @@ +--- +subject: generator +status: landed +--- + +# 可达导出集合检查与 issue #2 剩余名称的处理 + +来源:issue #2 的第三、四条验收标准(未分析的小组逐个确认;verify-scripts 中加入 +可达导出集合检查)。前两条见 [`republish`](2026-11-28-dll-fs-republish-design.md) +(PR #9)与 [`skip-directive`](2026-11-28-skip-directive-design.md)(PR #10)。 + +## 现状 + +在 `e2f10c68` 上与 `99533232`(#1 之前的 main)比较每个模块的可达名称。按 +"模块自己原来就导出、现在够不到"归到根上,除 #10 已说明的三个 detail 组之外, +共 72 处(模块,名称)、37 个名称:issue 列出的小组,加上 issue 之后由 #5 带来的 9 个名称 +(`boost::size`、cobalt 的 main 三个、geometry 的 `fusion_adapt_detail` 三个与 +`mpl::count_if`、`mpl::aux::next_if`)。没有一处是只因为少了 `export import`。 + +## 原因 + +**旧生成器按特化重复导出。** 它用 libclang 的 USR 作键,签名里提到的特化有自己的 +USR:`function` 是 `c:@N@boost@S@function>#FI(#I)`,主模板是 +`c:@N@boost@ST>1#T@function`。认领表里没有前者,于是它被当成新实体,又导出一次 +`using boost::function;`。用基线的 `closure_from` 对一个合成 TU 实跑确认。#1 之后按 +主模板作键,名称只归第一个认领的模块;这些重复导出随之消失。 + +所以问题变成:每个模块对这个名称的依赖是不是真的,以及谁应当拥有它。 + +## 逐组处理 + +| 名称 | 模块 | 处理 | +|---|---|---| +| `boost::function` | functional(accumulators、bimap、multi_array、numeric 经由它) | **补回**:`[functional.deps] add = ["function"]` | +| `*_archetype` ×3 | regex | **补回**:`boost/concept_archetype.hpp` 归 concept_check | +| `boost::call_traits` | wave | **补回**:`boost/call_traits.hpp` 归 utility | +| `boost::mpl` ×14、`mpl::aux` ×2(46 处) | 13 个 | 说明:`[[unreachable]]` | +| `boost::parameter` ×4 | accumulators、graph、heap、lockfree | 说明:`[[unreachable]]` | +| `fusion::deque` | hana | 说明:`[[unreachable]]` | +| `container::(make_)transform_iterator` | interprocess | 说明:`[[unreachable]]` | +| `cobalt::main` 等 3 个 | cobalt | 说明:`[[unreachable]]` | +| `fusion_adapt_detail` ×3、`mpl::count_if`、`mpl::aux::next_if` | geometry | 说明:`[[unreachable]]` | +| `boost::size` | core | 已有 `drop`,改为按导出写法记录 | + +- **function**:`boost::overloaded_function` 的构造函数以 `boost::function` 为参数, + 是公开接口。写出它的是 `overloaded_function_detail::base` 的偏特化,包含它的是 + functional 自己的 `detail/` 头文件;签名闭包不走偏特化,包含边不读库自己的 + `detail/`,两边都看不到。上游 CMake 也链接 `Boost::function`。 +- **archetype、call_traits**:两个头文件在 `boost/` 顶层,文件名不是库名,没有归属, + 于是先处理到的 iterator、variant 认领了它们,而写进文档的 concept_check、utility + 反而没有导出。归属改正后,regex、wave 通过已有的边可达。concept_check 多导出 74 个 + 名称,iterator 少 74 个;utility 多 3 个,variant 少 3 个。variant 因此需要到 + utility 的边(上游 CMake 同样链接),bimap、serialization 的这条边由生成器自己得出。 +- **mpl、parameter、fusion**:这些库只以头文件方式使用(usage.md §2.3),没有模块 + 拥有它们的名称。在官方发布包 1.92.0 的 `libs/` 全部文档、示例和测试中搜索 + 这 56 处的每个写法,只有两处命中:accumulators 参考手册里静态成员的类型 + `parameter::keyword`,hana 的 fusion 示例(它自己包含 ``)。 +- **cobalt、geometry**:头文件有意不进 GMF,原因早已写在 usage.md §6,只是 + `skipped.txt` 没有记录。`count_if.hpp` 在 geometry 中只有 `boost_fusion.hpp` 包含。 + +issue 正文中"`mpl::aux::template_arity`、`mpl::order_impl`、`boost::parameter` 已在 +`skipped.txt` 中"的说法不再成立:前两个现在没有条目;flyweight 的 `drop` 说明不了 +heap、lockfree、graph 为什么丢了 `parameter` 的名称。 + +## 决定 + +**`[[unreachable]]`**(顶层,不属于某个库):`reason` 加 `names = {名称 = [模块]}`。 +生成器每个(模块,名称)写一行 ` unreachable -- `;未知模块、 +空原因、重复条目报错。它不影响导出,也不进入各库的策略摘要。 + +**`tools/ci/check_reachable.py`**,由 `verify_generated.py` 在 `gen_exports.py --check` +之后运行: + +- 可达集合与 issue 中脚本的定义相同:自己的 `.inc` 加上 `src/*.cppm` 中 + `export import` 的传递闭包。解析补上了运算符、别名声明和命名空间别名。 +- **按(模块,名称)匹配。** 一个条目只说明它自己的模块。模块自己导出过的名称, + 必须有自己的条目;只是从导入得来的名称,由丢掉它的那个模块说明。去掉了导入、 + 而被导入模块仍有该名称时,报在去掉导入的模块上。 +- **`skip-directive` 只说明经由指令的写法**:`::X` 丢失时,要求 `::X` 仍然 + 可达。为此 `skipped.txt` 的这些行加上了 `using , ...`。否则 + `ublas::detail` 自己声明的名称丢了,也会被这一行盖过去。 +- **`unreachable` 过期即报错**:模块实际可达该名称。 +- **两个基线**:固定的 `99533232`,以及 CI 的基准(PR 的 merge base,或 push 之前的 + 提交)。只有前者的话,之后新增的名称(`boost::dll::fs` 的大部分、conversion 模块) + 再丢失就看不出来;只有后者的话,合并之后说明就再也不受检查。 +- 基线与被删除的模块写成脚本中的常量,升级 Boost 时移动基线的办法写在旁边。 + +**`drop` 按导出写法记录**:`core drop std::size` 改为 `core drop boost::size`, +`align drop std::alignment_of` 同理。导入者丢失的是前者。 + +## 验证 + +- 反向路径(真实数据的副本):去掉 functional 的 function 导入、删掉 + `dll.inc` 中 `unique_path`、删掉一条 `unreachable`、删掉 `core drop`、加一条过期条目、 + 从 `numeric.inc` 删掉 `ublas::matrix`、删掉 crc 模块,七种都报错并指出位置。 +- 用 #5 的树(`34d6fc8c`,当时 verify-scripts 通过)运行:912 处未说明。 +- 正向:对两个基线都是 0 处未说明;与 `e2f10c68` 相比没有任何模块少名称。 + +## 否决的做法 + +- **`drop` 不再占用无主名称的归属**:flyweight 丢弃的 `boost::parameter` 名称,后面的 + 库也不再导出。试做并全量生成:heap 补回 3 个名称,lockfree、graph 仍然够不到(没有到 + heap 的边),而 heap 多导出 48 个 `parameter::aux`,statechart 多导出 9 个 + `boost::detail` 的实现细节。收益小于代价。 +- **无主名称由每个提到它的模块各自导出**:可以补回全部 mpl 名称,但每个模块的导出都会 + 大幅增加,且让"碰巧可达"变成接口。 +- **按命名空间放行 `boost::mpl`、`boost::parameter`**:会让以后的丢失再次静默。 +- **把"每个旧名称仍可达"写进 `gen_exports.py --check`**:那里没有历史,也不看 + `src/*.cppm` 的导入图。 +- **提交一份可达集合的快照文件**:约 16 MB,且减少只体现为 diff,不会报错。 + +## 顺带发现(未处理) + +包含边不读库自己 `detail/` 头文件中的 `#include`(`lib_deps` 在目标库的根上停止)。 +按传递闭包计算,全仓有 56 条这样的边不在 `.deps` 中(例如 numeric → units、 +gil → filesystem);哪些对导入者有意义需要逐条分析。 + +## 测试 + +`tools/tests/test_check_reachable.py`(解析、可达闭包、归因、`skip-directive`、过期条目)、 +`tools/tests/test_gen_exports_unreachable.py`(条目、报错、`skipped.txt` 往返)。 +`tests/{functional,concept_check,utility,variant}.cpp` 与 `tests/regex/smoke.cpp` +断言补回的名称。 diff --git a/.agents/docs/README.md b/.agents/docs/README.md index 92a7318c..b8669b62 100644 --- a/.agents/docs/README.md +++ b/.agents/docs/README.md @@ -27,7 +27,7 @@ - `todos/` 放尚未完成的工作项,它们不是决定的记录。 - 移动或改名用 `tools/doc-tools/move_record.py`,它同时改写仓库中对该文件的引用。 -共 30 篇记录(其中 0 篇已归档),1 项待办。 +共 31 篇记录(其中 0 篇已归档),1 项待办。 ## 进行中 @@ -45,6 +45,7 @@ ### generator +- [可达导出集合检查与 issue #2 剩余名称的处理](2026-11-29-reachable-exports-design.md) — landed - [不跟随的 using 指令必须声明:策略 `skip-directive`](2026-11-28-skip-directive-design.md) — landed - [`boost::dll::fs` 跟随 `boost::filesystem`:策略 `republish`](2026-11-28-dll-fs-republish-design.md) — landed @@ -65,6 +66,7 @@ ### 2026-11 +- [可达导出集合检查与 issue #2 剩余名称的处理](2026-11-29-reachable-exports-design.md) — landed - [不跟随的 using 指令必须声明:策略 `skip-directive`](2026-11-28-skip-directive-design.md) — landed - [`boost::dll::fs` 跟随 `boost::filesystem`:策略 `republish`](2026-11-28-dll-fs-republish-design.md) — landed - [PR #5 第二轮评审的 [nit] 修复:覆盖率按测试程序列出的用例核对](2026-11-21-pr5-review-nits-design.md) — active diff --git a/docs/architecture.md b/docs/architecture.md index 3b1319ba..b6862052 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -197,13 +197,15 @@ written reason and applied by the generator, never patched into its output: | `[[.extra]]` | verbatim declarations (the gcc `extern template` vtable workarounds) | | `[[.republish]]` | the namespace holds `using namespace ;` for another library's namespace: every name that library exports directly in `` is re-exported through it, optionally under `if` (`boost::dll::fs` follows `boost::filesystem`) | | `[[.skip-directive]]` | the namespace's `using namespace X;` is an implementation convenience, not a public spelling (`namespace ublas { namespace detail { using namespace boost::numeric::ublas; } }`): it is not followed, and the reason is recorded | +| `[[unreachable]]` | names importers of the listed modules could once spell and no longer can (a Boost.MPL name several modules exported by accident), with the reason; see `check_reachable.py` in §5.4 | | `add` | names no collector reaches (body-only or ADL-only references) | | `gmf`, `defines`, `facade-includes` | the bundle's include set and macros; facade-only includes | | `inline-namespaces` | export a macro-selected inline namespace through its parent | | `[.deps]` | module edge corrections; edges of the hand-written special modules | -`generated/meta/skipped.txt` lists every name a rule guards, drops or adds, and -each `extra` / `republish` / `skip-directive` namespace, so the boundary is reviewable in one file, +`generated/meta/skipped.txt` lists every name a rule guards, drops, adds or +declares unreachable, and each `extra` / `republish` / `skip-directive` +namespace, so the boundary is reviewable in one file, and `generated/meta/api-surface.json` records the generator identity (clang release, target, defines) and per-library GMF, export count and edges. A diff after a compiler update therefore shows as a @@ -214,6 +216,14 @@ generator change, not as an unexplained API change. - `gen_exports.py --check` regenerates into a scratch copy and compares every generated file byte for byte, then verifies each facade's GMF against the bundle; it never writes the tree. CI runs it on Linux, macOS and Windows. +- `tools/ci/check_reachable.py` compares, module by module, the names an importer + reaches (the module's own list plus everything it `export import`s) with a + pinned baseline revision and, in CI, with the base of the change. A name that + went must be explained in `skipped.txt` by the module it went from: a `drop`, + an `unreachable`, or a `skip-directive` whose target still has the name. + `unreachable` entries for a name the module does reach are rejected. Byte-identical + output (`--check`) says nothing about this: a name can be lost by a change the + generator reproduces exactly. - `import_boost.py` is the single upstream import: URL, archive SHA-256, kept entries, pruned directories/files and the CRLF-normalized files are recorded in `upstream/boost/SOURCE.md`. The release `README.md` and `LICENSE_1_0.txt` are @@ -308,7 +318,7 @@ keeps byte-identical notices. them from the root with `mcpp test -p ` and the root's feature set, so they reuse the package objects and BMIs of the root `mcpp build`. - `tools/ci/verify_generated.py`: patch replay, `gen_exports.py --check`, - `gen_features.py --check` and the audits on a clean tree on all three host + `check_reachable.py`, `gen_features.py --check` and the audits on a clean tree on all three host platforms, then `git status` must be clean; a second build on the same configuration records the incremental TU count and mtimes. - `tools/check_mwrap_release.py`: identity, version scheme, tag, licence split and diff --git a/docs/architecture.zh.md b/docs/architecture.zh.md index a1d9d803..f86ce4eb 100644 --- a/docs/architecture.zh.md +++ b/docs/architecture.zh.md @@ -171,13 +171,14 @@ clang++ -std=c++23 --target=x86_64-w64-mingw32 --sysroot= \ | `[[.drop]]` | 永不导出匹配的名字 / 命名空间 | | `[[.extra]]` | 原样声明(gcc `extern template` 虚表变通) | | `[[.republish]]` | 该命名空间中有指向另一个库命名空间的 `using namespace ;`:把那个库直接导出在 `` 中的所有名字经由该命名空间再导出,可选 `if` 条件(`boost::dll::fs` 跟随 `boost::filesystem`) | +| `[[unreachable]]` | 列出的模块的导入者曾经能写、现在写不出的名字(例如多个模块碰巧都导出过的 Boost.MPL 名字),附原因;见 §5.4 的 `check_reachable.py` | | `add` | 没有收集器能到达的名字(只在函数体或 ADL 中出现的引用) | | `gmf`、`defines`、`facade-includes` | bundle 的 include 集合与宏;仅门面使用的 include | | `inline-namespaces` | 经由父命名空间导出由宏选择的 inline 命名空间 | | `[[.skip-directive]]` | 该命名空间中的 `using namespace X;` 只是实现上的便利,不是公开写法(`namespace ublas { namespace detail { using namespace boost::numeric::ublas; } }`):不跟随,并记录原因 | | `[.deps]` | 模块边修正;手写特殊模块的边 | -`generated/meta/skipped.txt` 列出每条规则守卫、丢弃或添加的名字,以及每个 +`generated/meta/skipped.txt` 列出每条规则守卫、丢弃、添加或声明不可达的名字,以及每个 `extra` / `republish` / `skip-directive` 命名空间,边界可以在一个文件里审阅;`generated/meta/api-surface.json` 记录生成器身份(clang 版本、目标、 宏定义)以及每个库的 GMF、导出数和边。因此编译器升级后的差异会显示为生成器 变化,而不是无法解释的 API 变化。 @@ -187,6 +188,12 @@ clang++ -std=c++23 --target=x86_64-w64-mingw32 --sysroot= \ - `gen_exports.py --check` 在临时副本中重新生成,逐字节比较每个生成文件,再对照 bundle 校验每个门面的 GMF;它从不写代码树。CI 在 Linux、macOS、Windows 上 运行它。 +- `tools/ci/check_reachable.py` 逐模块比较导入者可达的名字(模块自己的列表加上它 + `export import` 的一切)与一个固定的基线版本,在 CI 中还与本次改动的基准比较。 + 少掉的名字必须由丢掉它的那个模块在 `skipped.txt` 中说明:`drop`、 + `unreachable`,或目标命名空间中仍有该名字的 `skip-directive`。模块实际可达的 + 名字若有 `unreachable` 条目则报错。逐字节一致(`--check`)不能说明这一点: + 生成器能精确复现的改动同样可能丢掉名字。 - `import_boost.py` 是唯一的上游导入入口:URL、压缩包 SHA-256、保留的条目、 裁剪掉的目录/文件以及做过 CRLF 规范化的文件,全部记录在 `upstream/boost/SOURCE.md` 中。发行版自带的 `README.md` 和 @@ -269,7 +276,8 @@ feature(两种 Boost.Test 形态绝不能链接在一起)。 排除。它们是根工作区的成员,CI 在根目录以 `mcpp test -p <成员>` 和根工程 的 feature 集合运行,从而复用根工程 `mcpp build` 的目标文件与 BMI。 - `tools/ci/verify_generated.py`:在三种宿主平台的干净代码树上跑补丁重放、 - `gen_exports.py --check`、`gen_features.py --check` 和审计,最后 `git status` + `gen_exports.py --check`、`check_reachable.py`、`gen_features.py --check` 和审计, + 最后 `git status` 必须干净;在同一配置上再做一次构建,记录增量 TU 数量和 mtime。 - `tools/check_mwrap_release.py`:校验标识、版本方案、tag、许可证拆分以及保留 文档的字节。 diff --git a/docs/usage.md b/docs/usage.md index ae4f6f81..17672a29 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -86,6 +86,11 @@ Some libraries are consumed by header only. They have no module and no feature. | Macro APIs | `preprocessor`, `mpl`, `fusion`, `proto`, `spirit`, `xpressive`, `typeof`, `vmd`, `phoenix`, `parameter`, `metaparse`, `function_types`, `tti`, `local_function`, `msm`, `foreach` | The public surface is a macro family; a named module cannot export macros | | Compiler/defect fallbacks | `predef`, `static_assert`, `exception`, `describe`, `openmethod`, `scope_exit` | Macro-body API, a keyword module name, include+import ODR conflicts, or gcc CMI pendings bugs | +Some modules export a few names of these libraries (`boost::mpl::lambda`, +`boost::parameter::keyword`) because their own signatures mention them. Which +module does is not an interface to rely on: a program that spells such a name +includes the library's header. + `static_assert` cannot be a module at all: its name is a C++ keyword, so `export module ...boost.static_assert;` is invalid. `boost/exception/all.hpp` must be included by consumers: gcc 16.1 fails to load the module's pendings in diff --git a/docs/usage.zh.md b/docs/usage.zh.md index f80b54b8..1d0d09d7 100644 --- a/docs/usage.zh.md +++ b/docs/usage.zh.md @@ -70,6 +70,8 @@ BOOST_SCOPE_EXIT(void) { /* ... */ } BOOST_SCOPE_EXIT_END | 宏 API | `preprocessor`、`mpl`、`fusion`、`proto`、`spirit`、`xpressive`、`typeof`、`vmd`、`phoenix`、`parameter`、`metaparse`、`function_types`、`tti`、`local_function`、`msm`、`foreach` | 公开接口是一组宏;具名模块无法导出宏 | | 编译器/缺陷回退 | `predef`、`static_assert`、`exception`、`describe`、`openmethod`、`scope_exit` | 宏体 API、与关键字同名的模块名、include+import 的 ODR 冲突,或 gcc 的 CMI pendings 缺陷 | +有些模块会导出这些库的少数名称(`boost::mpl::lambda`、`boost::parameter::keyword`),因为它们自己的签名提到了这些名称。由哪个模块导出不是可以依赖的接口:程序若要写出这样的名称,应包含该库的头文件。 + `static_assert` 完全无法成为模块:其名称是 C++ 关键字,因此 `export module ...boost.static_assert;` 非法。消费者必须包含 `boost/exception/all.hpp`:在任何真实的消费者翻译单元中,gcc 16.1 都无法加载该模块的 pendings。 ### 2.4 无模块的编译库 diff --git a/generated/exports/algorithm.deps b/generated/exports/algorithm.deps index 974b92bd..cac24113 100644 --- a/generated/exports/algorithm.deps +++ b/generated/exports/algorithm.deps @@ -3,7 +3,6 @@ mcpplibs.mwrap.boost.bind mcpplibs.mwrap.boost.concept_check mcpplibs.mwrap.boost.config mcpplibs.mwrap.boost.core -mcpplibs.mwrap.boost.function mcpplibs.mwrap.boost.range mcpplibs.mwrap.boost.smart_ptr mcpplibs.mwrap.boost.throw_exception diff --git a/generated/exports/bimap.deps b/generated/exports/bimap.deps index 32d91aa5..52aa860b 100644 --- a/generated/exports/bimap.deps +++ b/generated/exports/bimap.deps @@ -6,3 +6,4 @@ mcpplibs.mwrap.boost.functional mcpplibs.mwrap.boost.lambda mcpplibs.mwrap.boost.multi_index mcpplibs.mwrap.boost.type_traits +mcpplibs.mwrap.boost.utility diff --git a/generated/exports/concept_check.inc b/generated/exports/concept_check.inc index 7d1c9a34..dec11d72 100644 --- a/generated/exports/concept_check.inc +++ b/generated/exports/concept_check.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=concept_check boost=1.92.0 target=x86_64-w64-mingw32 entities=143 +// lib=concept_check boost=1.92.0 target=x86_64-w64-mingw32 entities=217 export namespace boost { using boost::AdaptableBinaryFunction; @@ -120,14 +120,87 @@ export namespace boost { using boost::UniqueAssociativeContainerConcept; using boost::UnsignedInteger; using boost::UnsignedIntegerConcept; + using boost::addable_archetype; + using boost::assignable_archetype; + using boost::bidirectional_iterator_archetype; + using boost::binary_function_archetype; + using boost::binary_predicate_archetype; + using boost::boolean_archetype; + using boost::comparable_archetype; using boost::concept_check; using boost::concept_check_; using boost::concept_check_failed; using boost::constraint_check; using boost::constraint_check_failed; + using boost::convertible_from_archetype; + using boost::convertible_to_archetype; + using boost::copy_constructible_archetype; + using boost::default_archetype_base; + using boost::default_constructible_archetype; + using boost::dividable_archetype; + using boost::divide_op_first_archetype; + using boost::divide_op_second_archetype; + using boost::equal_op_first_archetype; + using boost::equal_op_second_archetype; + using boost::equality_comparable2_first_archetype; + using boost::equality_comparable2_second_archetype; + using boost::equality_comparable_archetype; + using boost::forward_iterator_archetype; using boost::function_requires; + using boost::generator_archetype; + using boost::greater_equal_op_first_archetype; + using boost::greater_equal_op_second_archetype; + using boost::greater_than_op_first_archetype; + using boost::greater_than_op_second_archetype; using boost::ignore_unused_variable_warning; + using boost::input_iterator_archetype; + using boost::input_iterator_archetype_no_proxy; + using boost::input_output_iterator_archetype; + using boost::less_equal_op_first_archetype; + using boost::less_equal_op_second_archetype; + using boost::less_than_comparable_archetype; + using boost::less_than_op_first_archetype; + using boost::less_than_op_second_archetype; + using boost::mod_op_first_archetype; + using boost::mod_op_second_archetype; + using boost::modable_archetype; + using boost::multipliable_archetype; + using boost::mutable_bidirectional_iterator_archetype; + using boost::mutable_forward_iterator_archetype; + using boost::mutable_random_access_iterator_archetype; + using boost::not_equal_op_first_archetype; + using boost::not_equal_op_second_archetype; + using boost::null_archetype; + using boost::operator!=; + using boost::operator%; + using boost::operator*; + using boost::operator+; + using boost::operator-; + using boost::operator/; + using boost::operator<; + using boost::operator<=; + using boost::operator==; + using boost::operator>; + using boost::operator>=; + using boost::optag1; + using boost::optag2; + using boost::optag3; + using boost::output_iterator_archetype; + using boost::output_proxy; + using boost::plus_op_first_archetype; + using boost::plus_op_second_archetype; + using boost::random_access_iterator_archetype; using boost::require_boolean_expr; + using boost::sgi_assignable_archetype; + using boost::static_object; + using boost::subtract_op_first_archetype; + using boost::subtract_op_second_archetype; + using boost::subtractable_archetype; + using boost::time_op_first_archetype; + using boost::time_op_second_archetype; + using boost::unary_function_archetype; + using boost::unary_predicate_archetype; + using boost::void_generator_archetype; } export namespace boost { namespace concept_checking { @@ -155,3 +228,7 @@ export namespace boost { namespace concepts { namespace detail { using boost::concepts::detail::wrap_constraints; using boost::concepts::detail::yes; }}} + +export namespace boost { namespace detail { + using boost::detail::dummy_constructor; +}} diff --git a/generated/exports/functional.deps b/generated/exports/functional.deps index 615a06d0..6dea1e9a 100644 --- a/generated/exports/functional.deps +++ b/generated/exports/functional.deps @@ -2,5 +2,6 @@ mcpplibs.mwrap.boost.assert mcpplibs.mwrap.boost.config mcpplibs.mwrap.boost.container_hash mcpplibs.mwrap.boost.core +mcpplibs.mwrap.boost.function mcpplibs.mwrap.boost.type_traits mcpplibs.mwrap.boost.utility diff --git a/generated/exports/iterator.inc b/generated/exports/iterator.inc index 67f3376f..732f5710 100644 --- a/generated/exports/iterator.inc +++ b/generated/exports/iterator.inc @@ -1,12 +1,11 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=iterator boost=1.92.0 target=x86_64-w64-mingw32 entities=968 +// lib=iterator boost=1.92.0 target=x86_64-w64-mingw32 entities=894 export namespace boost { using boost::access_archetype; using boost::addable; using boost::addable1; using boost::addable2; - using boost::addable_archetype; using boost::additive; using boost::additive1; using boost::additive2; @@ -18,48 +17,29 @@ export namespace boost { using boost::arithmetic1; using boost::arithmetic2; using boost::array; - using boost::assignable_archetype; using boost::bidirectional_iteratable; - using boost::bidirectional_iterator_archetype; using boost::bidirectional_iterator_helper; using boost::bidirectional_iterator_test; using boost::bidirectional_readable_iterator_test; using boost::bidirectional_traversal_tag; - using boost::binary_function_archetype; - using boost::binary_predicate_archetype; using boost::bitwise; using boost::bitwise1; using boost::bitwise2; - using boost::boolean_archetype; - using boost::comparable_archetype; using boost::const_nonconst_iterator_test; using boost::constant_lvalue_iterator_test; - using boost::convertible_from_archetype; - using boost::convertible_to_archetype; - using boost::copy_constructible_archetype; using boost::counting_iterator; using boost::decrementable; - using boost::default_archetype_base; - using boost::default_constructible_archetype; using boost::dereferenceable; using boost::distance; using boost::dividable; using boost::dividable1; using boost::dividable2; using boost::dividable2_left; - using boost::dividable_archetype; - using boost::divide_op_first_archetype; - using boost::divide_op_second_archetype; using boost::dummyT; using boost::enable_if_convertible; - using boost::equal_op_first_archetype; - using boost::equal_op_second_archetype; using boost::equality_comparable; using boost::equality_comparable1; using boost::equality_comparable2; - using boost::equality_comparable2_first_archetype; - using boost::equality_comparable2_second_archetype; - using boost::equality_comparable_archetype; using boost::equivalent; using boost::equivalent1; using boost::equivalent2; @@ -74,7 +54,6 @@ export namespace boost { using boost::field_operators2; using boost::filter_iterator; using boost::forward_iteratable; - using boost::forward_iterator_archetype; using boost::forward_iterator_helper; using boost::forward_iterator_test; using boost::forward_readable_iterator_test; @@ -82,13 +61,8 @@ export namespace boost { using boost::forward_traversal_tag; using boost::function_input_iterator; using boost::function_output_iterator; - using boost::generator_archetype; using boost::generator_iterator; using boost::generator_iterator_generator; - using boost::greater_equal_op_first_archetype; - using boost::greater_equal_op_second_archetype; - using boost::greater_than_op_first_archetype; - using boost::greater_than_op_second_archetype; using boost::incrementable; using boost::incrementable_traversal_tag; using boost::indexable; @@ -97,11 +71,8 @@ export namespace boost { using boost::indirect_reference_t; using boost::infinite; using boost::input_iteratable; - using boost::input_iterator_archetype; - using boost::input_iterator_archetype_no_proxy; using boost::input_iterator_helper; using boost::input_iterator_test; - using boost::input_output_iterator_archetype; using boost::integer_arithmetic; using boost::integer_arithmetic1; using boost::integer_arithmetic2; @@ -134,14 +105,9 @@ export namespace boost { using boost::left_shiftable; using boost::left_shiftable1; using boost::left_shiftable2; - using boost::less_equal_op_first_archetype; - using boost::less_equal_op_second_archetype; using boost::less_than_comparable; using boost::less_than_comparable1; using boost::less_than_comparable2; - using boost::less_than_comparable_archetype; - using boost::less_than_op_first_archetype; - using boost::less_than_op_second_archetype; using boost::lvalue_test; using boost::make_counting_iterator; using boost::make_filter_iterator; @@ -155,45 +121,21 @@ export namespace boost { using boost::make_shared_container_range; using boost::make_transform_iterator; using boost::make_zip_iterator; - using boost::mod_op_first_archetype; - using boost::mod_op_second_archetype; using boost::modable; using boost::modable1; using boost::modable2; using boost::modable2_left; - using boost::modable_archetype; using boost::multipliable; using boost::multipliable1; using boost::multipliable2; - using boost::multipliable_archetype; using boost::multiplicative; using boost::multiplicative1; using boost::multiplicative2; - using boost::mutable_bidirectional_iterator_archetype; - using boost::mutable_forward_iterator_archetype; - using boost::mutable_random_access_iterator_archetype; using boost::mutable_trivial_iterator_test; using boost::no_traversal_tag; using boost::non_const_lvalue_iterator_test; - using boost::not_equal_op_first_archetype; - using boost::not_equal_op_second_archetype; - using boost::null_archetype; - using boost::operator!=; - using boost::operator%; - using boost::operator*; - using boost::operator+; - using boost::operator-; - using boost::operator/; - using boost::operator<; - using boost::operator<=; - using boost::operator==; - using boost::operator>; - using boost::operator>=; using boost::operators; using boost::operators2; - using boost::optag1; - using boost::optag2; - using boost::optag3; using boost::orable; using boost::orable1; using boost::orable2; @@ -210,19 +152,14 @@ export namespace boost { using boost::ordered_ring_operators1; using boost::ordered_ring_operators2; using boost::output_iteratable; - using boost::output_iterator_archetype; using boost::output_iterator_helper; - using boost::output_proxy; using boost::partially_ordered; using boost::partially_ordered1; using boost::partially_ordered2; using boost::permutation_iterator; - using boost::plus_op_first_archetype; - using boost::plus_op_second_archetype; using boost::pointee; using boost::pointee_t; using boost::random_access_iteratable; - using boost::random_access_iterator_archetype; using boost::random_access_iterator_helper; using boost::random_access_iterator_test; using boost::random_access_readable_iterator_test; @@ -236,23 +173,16 @@ export namespace boost { using boost::ring_operators; using boost::ring_operators1; using boost::ring_operators2; - using boost::sgi_assignable_archetype; using boost::shared_container_iterator; using boost::shiftable; using boost::shiftable1; using boost::shiftable2; using boost::single_pass_traversal_tag; - using boost::static_object; - using boost::subtract_op_first_archetype; - using boost::subtract_op_second_archetype; using boost::subtractable; using boost::subtractable1; using boost::subtractable2; using boost::subtractable2_left; - using boost::subtractable_archetype; using boost::swappable_iterator_test; - using boost::time_op_first_archetype; - using boost::time_op_second_archetype; using boost::totally_ordered; using boost::totally_ordered1; using boost::totally_ordered2; @@ -260,11 +190,8 @@ export namespace boost { using boost::traversal_archetype; using boost::traversal_archetype_base; using boost::trivial_iterator_test; - using boost::unary_function_archetype; - using boost::unary_predicate_archetype; using boost::undefined; using boost::unit_steppable; - using boost::void_generator_archetype; using boost::writable_iterator_test; using boost::writable_iterator_traversal_test; using boost::xorable; @@ -276,7 +203,6 @@ export namespace boost { export namespace boost { namespace detail { using boost::detail::digit_traits; - using boost::detail::dummy_constructor; using boost::detail::integer_traits; using boost::detail::is_incrementable; using boost::detail::is_postfix_incrementable; diff --git a/generated/exports/serialization.deps b/generated/exports/serialization.deps index c2fc8e9b..ccc66a81 100644 --- a/generated/exports/serialization.deps +++ b/generated/exports/serialization.deps @@ -10,3 +10,4 @@ mcpplibs.mwrap.boost.optional mcpplibs.mwrap.boost.smart_ptr mcpplibs.mwrap.boost.throw_exception mcpplibs.mwrap.boost.type_traits +mcpplibs.mwrap.boost.utility diff --git a/generated/exports/utility.inc b/generated/exports/utility.inc index 2345a404..413318be 100644 --- a/generated/exports/utility.inc +++ b/generated/exports/utility.inc @@ -1,9 +1,10 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=utility boost=1.92.0 target=x86_64-w64-mingw32 entities=75 +// lib=utility boost=1.92.0 target=x86_64-w64-mingw32 entities=78 export namespace boost { using boost::base_from_member; using boost::basic_string_view; + using boost::call_traits; using boost::compressed_pair; using boost::equal_pointees; using boost::equal_pointees_t; @@ -59,6 +60,8 @@ export namespace boost { export namespace boost { namespace detail { using boost::detail::cpp0x_result_of; using boost::detail::cpp0x_result_of_impl; + using boost::detail::ct_imp; + using boost::detail::ct_imp2; using boost::detail::enable_if_unrelated; using boost::detail::is_function_with_no_args; using boost::detail::is_related; diff --git a/generated/exports/variant.deps b/generated/exports/variant.deps index 2e048570..949523c4 100644 --- a/generated/exports/variant.deps +++ b/generated/exports/variant.deps @@ -6,3 +6,4 @@ mcpplibs.mwrap.boost.integer mcpplibs.mwrap.boost.throw_exception mcpplibs.mwrap.boost.type_index mcpplibs.mwrap.boost.type_traits +mcpplibs.mwrap.boost.utility diff --git a/generated/exports/variant.inc b/generated/exports/variant.inc index d11e2808..761d5510 100644 --- a/generated/exports/variant.inc +++ b/generated/exports/variant.inc @@ -1,5 +1,5 @@ // GENERATED by tools/gen_exports.py - DO NOT EDIT -// lib=variant boost=1.92.0 target=x86_64-w64-mingw32 entities=347 +// lib=variant boost=1.92.0 target=x86_64-w64-mingw32 entities=344 export namespace boost { using boost::apply_visitor; @@ -9,7 +9,6 @@ export namespace boost { using boost::bad_polymorphic_get; using boost::bad_visit; using boost::blank; - using boost::call_traits; using boost::get; using boost::hash_value; using boost::is_recursive_wrapper; @@ -40,8 +39,6 @@ export namespace boost { } export namespace boost { namespace detail { - using boost::detail::ct_imp; - using boost::detail::ct_imp2; using boost::detail::is_recursive_wrapper_impl; using boost::detail::is_static_visitor_impl; using boost::detail::is_static_visitor_tag; diff --git a/generated/meta/api-surface.json b/generated/meta/api-surface.json index 85688f88..05458e2a 100644 --- a/generated/meta/api-surface.json +++ b/generated/meta/api-surface.json @@ -40,7 +40,6 @@ "concept_check", "config", "core", - "function", "range", "smart_ptr", "throw_exception", @@ -232,7 +231,8 @@ "functional", "lambda", "multi_index", - "type_traits" + "type_traits", + "utility" ], "exported": 192, "gmf": [ @@ -399,8 +399,9 @@ "config", "type_traits" ], - "exported": 143, + "exported": 217, "gmf": [ + "boost/concept_archetype.hpp", "boost/concept_check.hpp", "boost/concept_check/borland.hpp", "boost/concept_check/general.hpp" @@ -768,6 +769,7 @@ "config", "container_hash", "core", + "function", "type_traits", "utility" ], @@ -1338,7 +1340,7 @@ "type_traits", "utility" ], - "exported": 968, + "exported": 894, "gmf": [ "boost/iterator.hpp", "boost/iterator/advance.hpp", @@ -2170,7 +2172,8 @@ "optional", "smart_ptr", "throw_exception", - "type_traits" + "type_traits", + "utility" ], "exported": 401, "gmf": [ @@ -2701,8 +2704,9 @@ "throw_exception", "type_traits" ], - "exported": 75, + "exported": 78, "gmf": [ + "boost/call_traits.hpp", "boost/compressed_pair.hpp", "boost/utility.hpp", "boost/utility/addressof.hpp", @@ -2744,9 +2748,10 @@ "integer", "throw_exception", "type_index", - "type_traits" + "type_traits", + "utility" ], - "exported": 347, + "exported": 344, "gmf": [ "boost/variant.hpp", "boost/variant/multivisitors.hpp", diff --git a/generated/meta/libs.json b/generated/meta/libs.json index 436507b8..4e626b4c 100644 --- a/generated/meta/libs.json +++ b/generated/meta/libs.json @@ -817,6 +817,7 @@ "boost/compat/type_traits.hpp" ], "concept_check": [ + "boost/concept_archetype.hpp", "boost/concept_check.hpp", "boost/concept_check/borland.hpp", "boost/concept_check/general.hpp" @@ -5653,6 +5654,7 @@ "boost/url/variant.hpp" ], "utility": [ + "boost/call_traits.hpp", "boost/compressed_pair.hpp", "boost/utility.hpp", "boost/utility/addressof.hpp", diff --git a/generated/meta/skipped.txt b/generated/meta/skipped.txt index 7bccd3af..11395376 100644 --- a/generated/meta/skipped.txt +++ b/generated/meta/skipped.txt @@ -1,11 +1,17 @@ -# Names the export policy (tools/export_policy.toml) guards, drops or -# adds verbatim, and the using-directives it does not follow. +# Names the export policy (tools/export_policy.toml) guards, drops, +# adds verbatim or declares unreachable, and the using-directives it +# does not follow. tools/ci/check_reachable.py reads this file. # GENERATED by tools/gen_exports.py - DO NOT EDIT # [if ] -- +# skip-directive using , ... -- -accumulators skip-directive boost::accumulators::impl -- boost/accumulators/accumulators_fwd.hpp opens `namespace impl { using namespace numeric::operators; }` for the same reason as numeric::functional: the accumulator implementations apply the numeric operators unqualified. accumulators::impl::X is spelled upstream only for impl's own accumulator templates, which are exported directly; none goes through the directive. -accumulators skip-directive boost::numeric::functional -- boost/accumulators/numeric/functional_fwd.hpp declares namespace boost::numeric::operators "for using directives" and pulls it into numeric::functional with `using namespace operators;`, so the functional objects find the std::vector / std::valarray / std::complex operator overloads unqualified. The operators' public spelling is boost::numeric::operators (a user writes their own `using namespace boost::numeric::operators;`); no Boost header, test or example names one as numeric::functional::X. -align drop std::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. +accumulators skip-directive boost::accumulators::impl using boost::numeric::operators -- boost/accumulators/accumulators_fwd.hpp opens `namespace impl { using namespace numeric::operators; }` for the same reason as numeric::functional: the accumulator implementations apply the numeric operators unqualified. accumulators::impl::X is spelled upstream only for impl's own accumulator templates, which are exported directly; none goes through the directive. +accumulators skip-directive boost::numeric::functional using boost::numeric::operators -- boost/accumulators/numeric/functional_fwd.hpp declares namespace boost::numeric::operators "for using directives" and pulls it into numeric::functional with `using namespace operators;`, so the functional objects find the std::vector / std::valarray / std::complex operator overloads unqualified. The operators' public spelling is boost::numeric::operators (a user writes their own `using namespace boost::numeric::operators;`); no Boost header, test or example names one as numeric::functional::X. +accumulators 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. +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. +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. asio guard boost::asio::basic_file if defined(BOOST_ASIO_HAS_FILE) -- Asio's file support (basic_file and friends) is declared only where BOOST_ASIO_HAS_FILE (IOCP / io_uring); the MinGW snapshot has it. @@ -92,6 +98,9 @@ beast guard boost::beast::http::detail::run_write_some_win32_op if defined(_WIN3 beast guard boost::beast::http::detail::write_some_win32_op if defined(_WIN32) -- Beast's Win32 file and debug-stream helpers (file_win32.hpp, detail/ostream dstream) are Windows-only. beast guard boost::beast::unit_test::basic_dstream if defined(_WIN32) -- Beast's Win32 file and debug-stream helpers (file_win32.hpp, detail/ostream dstream) are Windows-only. beast guard boost::beast::unit_test::detail::dstream_buf if defined(_WIN32) -- Beast's Win32 file and debug-stream helpers (file_win32.hpp, detail/ostream dstream) are Windows-only. +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). 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). @@ -99,7 +108,10 @@ cobalt extra boost::cobalt::this_coro -- boost/cobalt/this_coro.hpp brings asio' cobalt guard boost::cobalt::io::sctp if defined(IPPROTO_SCTP) -- boost/cobalt/io/endpoint.hpp declares the SCTP protocol constants only where the platform defines IPPROTO_SCTP (MinGW does, MSVC's SDK does not). cobalt guard boost::cobalt::io::sctp_v4 if defined(IPPROTO_SCTP) -- boost/cobalt/io/endpoint.hpp declares the SCTP protocol constants only where the platform defines IPPROTO_SCTP (MinGW does, MSVC's SDK does not). cobalt guard boost::cobalt::io::sctp_v6 if defined(IPPROTO_SCTP) -- boost/cobalt/io/endpoint.hpp declares the SCTP protocol constants only where the platform defines IPPROTO_SCTP (MinGW does, MSVC's SDK does not). -cobalt skip-directive boost::cobalt::this_coro -- `using namespace asio::this_coro;` is a public spelling (cobalt::this_coro::executor). The [[cobalt.extra]] for this namespace re-declares the names, following the documented outline of boost/cobalt/this_coro.hpp; the generator does not follow the directive itself. +cobalt skip-directive boost::cobalt::this_coro using boost::asio::this_coro -- `using namespace asio::this_coro;` is a public spelling (cobalt::this_coro::executor). The [[cobalt.extra]] for this namespace re-declares the names, following the documented outline of boost/cobalt/this_coro.hpp; the generator does not follow the directive itself. +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). 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. @@ -107,7 +119,9 @@ container guard ::SleepEx if defined(_WIN32) -- M11 platform guard: container_wi container guard boost::container::dtl::win_critical_section if defined(_WIN32) -- M11 platform guard: win_critical_section is the non-pthread branch of container/detail/thread_mutex.hpp; POSIX uses pthread_mutex. container guard boost::container_winapi::BOOL_ if defined(_WIN32) -- M11 platform guard: container_winapi DWORD_/BOOL_/SleepEx are declared only in the _WIN32 branch of container/detail/mutex.hpp. 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. -core drop std::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. +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. +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. core guard boost::core::detail::sp_thread_yield 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. @@ -207,9 +221,30 @@ flyweight drop boost::parameter::required -- The bundle pulls the transitive con functional guard boost::mpl::v_at_impl if defined(__GNUC__) -- M9 platform guard: gcc-preprocessed mpl vector headers only. functional guard boost::mpl::v_item if defined(__GNUC__) -- M9 platform guard: gcc-preprocessed mpl vector headers only. functional guard boost::mpl::v_mask if defined(__GNUC__) -- M9 platform guard: gcc-preprocessed mpl vector headers only. +functional unreachable boost::mpl::advance -- 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. +functional 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. +functional unreachable boost::mpl::aux::type_wrapper -- 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. +functional unreachable boost::mpl::distance -- 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. +functional 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. +functional unreachable boost::mpl::next -- 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. +functional unreachable boost::mpl::prior -- 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. +geometry unreachable boost::geometry::fusion_adapt_detail::all_same -- Declared or included by boost/geometry/geometries/adapted/boost_fusion.hpp alone, which the module does not include: in its global module fragment the Fusion adaptation and the boost::tuple adaptation match the same types. A program that adapts Fusion sequences includes the header itself, before the import (docs/usage.md §6, tests/geometry/examples_core_geometries_6.cpp). +geometry unreachable boost::geometry::fusion_adapt_detail::is_coordinate_size -- Declared or included by boost/geometry/geometries/adapted/boost_fusion.hpp alone, which the module does not include: in its global module fragment the Fusion adaptation and the boost::tuple adaptation match the same types. A program that adapts Fusion sequences includes the header itself, before the import (docs/usage.md §6, tests/geometry/examples_core_geometries_6.cpp). +geometry unreachable boost::geometry::fusion_adapt_detail::is_fusion_sequence -- Declared or included by boost/geometry/geometries/adapted/boost_fusion.hpp alone, which the module does not include: in its global module fragment the Fusion adaptation and the boost::tuple adaptation match the same types. A program that adapts Fusion sequences includes the header itself, before the import (docs/usage.md §6, tests/geometry/examples_core_geometries_6.cpp). +geometry unreachable boost::mpl::aux::next_if -- Declared or included by boost/geometry/geometries/adapted/boost_fusion.hpp alone, which the module does not include: in its global module fragment the Fusion adaptation and the boost::tuple adaptation match the same types. A program that adapts Fusion sequences includes the header itself, before the import (docs/usage.md §6, tests/geometry/examples_core_geometries_6.cpp). +geometry unreachable boost::mpl::count_if -- Declared or included by boost/geometry/geometries/adapted/boost_fusion.hpp alone, which the module does not include: in its global module fragment the Fusion adaptation and the boost::tuple adaptation match the same types. A program that adapts Fusion sequences includes the header itself, before the import (docs/usage.md §6, tests/geometry/examples_core_geometries_6.cpp). graph guard boost::proto::detail::template_arity if defined(BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) -- M11 platform guard: proto/detail/template_arity.hpp declares template_arity only under BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING (gcc extended-template matching). graph guard boost::proto::detail::template_arity_helper if defined(BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) -- M11 platform guard: proto/detail/template_arity.hpp declares template_arity_helper only under BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING (gcc extended-template matching). graph guard boost::proto::detail::template_arity_impl2 if defined(BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) -- M11 platform guard: proto/detail/template_arity.hpp declares template_arity_impl2 only under BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING (gcc extended-template matching). +graph unreachable boost::mpl::identity -- 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. +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 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. +heap 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. +heap 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. hof guard boost::hof::detail::bool_seq if !defined(_MSC_VER) -- C2 platform guard: bool_seq is the non-_MSC_VER branch of detail/and.hpp (the MSVC branch declares struct and_ instead). hof guard boost::hof::detail::callable_args if !BOOST_HOF_NO_EXPRESSION_SFINAE -- C2 platform guard: callable_args is the !NO_EXPRESSION_SFINAE branch of detail/can_be_called.hpp (config.hpp: _MSC_VER → 1). hof guard boost::hof::detail::called_val if !BOOST_HOF_NO_EXPRESSION_SFINAE -- C2 platform guard: called_val is the !NO_EXPRESSION_SFINAE branch of detail/can_be_called.hpp (config.hpp: _MSC_VER → 1). @@ -217,8 +252,8 @@ hof guard boost::hof::detail::can_be_called_impl if !BOOST_HOF_NO_EXPRESSION_SFI hof guard boost::hof::detail::eval_helper if !BOOST_HOF_NO_ORDERED_BRACE_INIT -- C2 platform guard: eval_helper is the !NO_ORDERED_BRACE_INIT branch of apply_eval.hpp (config.hpp: _MSC_VER → 1). hof guard boost::hof::operators::decrement if !defined(_MSC_VER) -- C2 platform guard: operators::decrement is the #ifndef _MSC_VER branch of placeholders.hpp (MSVC 2017 ICE on ++/-- constexpr). hof guard boost::hof::operators::increment if !defined(_MSC_VER) -- C2 platform guard: operators::increment is the #ifndef _MSC_VER branch of placeholders.hpp (MSVC 2017 ICE on ++/-- constexpr). -icl skip-directive boost::icl::Interval_Map -- boost/icl/detail/interval_map_algo.hpp: the interval_map counterpart of Interval_Set (`namespace Interval_Map { using namespace segmental; }`), with the same reasoning: an implementation namespace, spelled only inside icl's headers and only for its own members. -icl skip-directive boost::icl::Interval_Set -- boost/icl/detail/interval_set_algo.hpp opens `namespace Interval_Set { using namespace segmental; }`: the algorithm namespace behind the interval_set functions of boost/icl/concept/ uses icl::segmental's helpers unqualified. Interval_Set::X is spelled only inside icl's own headers and only for Interval_Set's own templates, which are exported directly; the segmental names keep their spelling boost::icl::segmental::X. +icl skip-directive boost::icl::Interval_Map using boost::icl::segmental -- boost/icl/detail/interval_map_algo.hpp: the interval_map counterpart of Interval_Set (`namespace Interval_Map { using namespace segmental; }`), with the same reasoning: an implementation namespace, spelled only inside icl's headers and only for its own members. +icl skip-directive boost::icl::Interval_Set using boost::icl::segmental -- boost/icl/detail/interval_set_algo.hpp opens `namespace Interval_Set { using namespace segmental; }`: the algorithm namespace behind the interval_set functions of boost/icl/concept/ uses icl::segmental's helpers unqualified. Interval_Set::X is spelled only inside icl's own headers and only for Interval_Set's own templates, which are exported directly; the segmental names keep their spelling boost::icl::segmental::X. interprocess guard boost::interprocess::basic_managed_windows_shared_memory if defined(_WIN32) -- The Windows shared-memory and synchronization surface (detail/win32_api.hpp chain); POSIX interprocess never declares it. interprocess guard boost::interprocess::ipcdetail::do_winapi_wait if defined(_WIN32) -- The Windows shared-memory and synchronization surface (detail/win32_api.hpp chain); POSIX interprocess never declares it. interprocess guard boost::interprocess::ipcdetail::file_time_to_microseconds if defined(_WIN32) -- The Windows shared-memory and synchronization surface (detail/win32_api.hpp chain); POSIX interprocess never declares it. @@ -455,10 +490,21 @@ interprocess guard boost::ipwinapiext::SetLastError if defined(_WIN32) -- M12 pl interprocess guard boost::ipwinapiext::VirtualLock if defined(_WIN32) -- M12 platform guard: registry / virtual-memory extension surface — Windows-only (win32_api.hpp chain). interprocess guard boost::ipwinapiext::VirtualProtect if defined(_WIN32) -- M12 platform guard: registry / virtual-memory extension surface — Windows-only (win32_api.hpp chain). interprocess guard boost::ipwinapiext::VirtualUnlock if defined(_WIN32) -- M12 platform guard: registry / virtual-memory extension surface — Windows-only (win32_api.hpp chain). +interprocess unreachable boost::container::make_transform_iterator -- An implementation detail of Boost.Container (boost/container/detail/transform_iterator.hpp) that boost/interprocess/detail/transform_iterator.hpp names by using-declaration. The generator before #1 exported the target instead of the name the declaration publishes, boost::interprocess::X, which the module now has. +interprocess unreachable boost::container::transform_iterator -- An implementation detail of Boost.Container (boost/container/detail/transform_iterator.hpp) that boost/interprocess/detail/transform_iterator.hpp names by using-declaration. The generator before #1 exported the target instead of the name the declaration publishes, boost::interprocess::X, which the module now has. intrusive guard boost::intrusive::detail::builtin_clz_dispatch if defined(__GNUC__) -- M9 platform guard: math.hpp defines builtin_clz_dispatch only in the __GNUC__ branch of the BSR intrinsic chain. iostreams guard boost::iostreams::detail::codecvt_impl if defined(BOOST_IOSTREAMS_NO_PRIMARY_CODECVT_DEFINITION) || \ defined(BOOST_IOSTREAMS_EMPTY_PRIMARY_CODECVT_DEFINITION) || \ defined(BOOST_IOSTREAMS_NO_LOCALE) -- M11 platform guard: detail/codecvt_helper.hpp declares codecvt_impl only on these std::codecvt workaround paths (libstdc++ mingw snapshot); the MSVC STL takes none of them. +iterator unreachable boost::mpl::advance -- 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. +iterator 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. +iterator unreachable boost::mpl::distance -- 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. +iterator 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. +iterator unreachable boost::mpl::next -- 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. +iterator unreachable boost::mpl::pop_front -- 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. +iterator unreachable boost::mpl::prior -- 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. lambda guard boost::lambda::ll::random_shuffle if !defined(BOOST_NO_CXX98_RANDOM_SHUFFLE) -- C4 flavor guard: random_shuffle is the !BOOST_NO_CXX98_RANDOM_SHUFFLE branch of algorithm.hpp (MSVC STL/libc++ under C++17 removed std::random_shuffle). leaf extra boost::leaf::detail -- M9: gcc 16.1.0 module consumers emit a partial vtable for exception (multi-base exception_base/error_id) whose non-virtual thunks stay undefined — gcc never emits them in a module consumer TU. This extern template suppresses the consumer's implicit instantiation; the complete vtable + thunks come from the explicit instantiation in port/leaf_extras.cpp (same pattern as thread's clone_impl, cf. M7c). +lockfree 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. +lockfree 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. 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. @@ -475,18 +521,29 @@ multiprecision guard boost::multiprecision::detail::addcarry_limb if defined(BOO multiprecision guard boost::multiprecision::detail::subborrow_limb if defined(BOOST_MP_HAS_IMMINTRIN_H) -- M11 platform guard: cpp_int/intel_intrinsics.hpp declares subborrow_limb only under BOOST_MP_HAS_IMMINTRIN_H (see addcarry_limb guard for rationale). multiprecision guard boost::multiprecision::int128_type if defined(BOOST_HAS_INT128) -- M12 platform guard: detail/standalone_config.hpp defines int128_type only under BOOST_HAS_INT128 (off under the clang-msvc flavor). multiprecision guard boost::multiprecision::uint128_type if defined(BOOST_HAS_INT128) -- M12 platform guard: as above (uint128_type). -multiprecision skip-directive boost::serialization::cpp_int_detail -- boost/multiprecision/cpp_int/serialize.hpp opens `namespace cpp_int_detail { using namespace boost::multiprecision; using namespace boost::multiprecision::backends; }` so its do_serialize helpers can name cpp_int_backend and number unqualified. The public entry point is the boost::serialization::serialize overload (exported), found by Boost.Serialization; upstream spells cpp_int_detail::X only for the helpers declared there (do_serialize, is_binary_archive, exported directly). Following the directive would re-spell all of multiprecision under boost::serialization::cpp_int_detail (355 names before #1). +multiprecision skip-directive boost::serialization::cpp_int_detail using boost::multiprecision, boost::multiprecision::backends -- boost/multiprecision/cpp_int/serialize.hpp opens `namespace cpp_int_detail { using namespace boost::multiprecision; using namespace boost::multiprecision::backends; }` so its do_serialize helpers can name cpp_int_backend and number unqualified. The public entry point is the boost::serialization::serialize overload (exported), found by Boost.Serialization; upstream spells cpp_int_detail::X only for the helpers declared there (do_serialize, is_binary_archive, exported directly). Following the directive would re-spell all of multiprecision under boost::serialization::cpp_int_detail (355 names before #1). nowide guard boost::nowide::detail::console_input_buffer if defined(_WIN32) -- M11 platform guard: console_input_buffer is the windows console machinery (detail/console_buffer.hpp); POSIX nowide uses std:: streams directly. nowide guard boost::nowide::detail::console_output_buffer if defined(_WIN32) -- M11 platform guard: console_output_buffer is the windows console machinery (detail/console_buffer.hpp); POSIX nowide uses std:: streams directly. nowide guard boost::nowide::detail::stat if defined(_WIN32) -- M11 platform guard: detail::stat is the BOOST_WINDOWS branch of stat.hpp; POSIX exposes ::stat via a using-declaration instead. nowide guard boost::nowide::detail::winconsole_istream if defined(_WIN32) -- M11 platform guard: winconsole_istream is the windows console stream branch of iostream.hpp; POSIX takes std:: streams directly. nowide guard boost::nowide::detail::winconsole_ostream if defined(_WIN32) -- M11 platform guard: winconsole_ostream is the windows console stream branch of iostream.hpp; POSIX takes std:: streams directly. numeric guard boost::numeric::ublas::same_impl_ex if !defined(NDEBUG) && !defined(BOOST_UBLAS_NDEBUG) -- Boost.uBLAS declares same_impl_ex only when size checks are on; a release build (NDEBUG) takes BOOST_UBLAS_USE_FAST_SAME and never declares it. -numeric skip-directive boost::numeric::ublas::detail -- boost/numeric/ublas/matrix.hpp and triangular.hpp open `namespace detail { using namespace boost::numeric::ublas; }` so the matrix_resize_preserve helpers can name uBLAS types unqualified. It is not a public spelling: every ublas::detail::X in Boost's headers, macros, tests and examples names a member declared in ublas::detail (tensor_expression, retrieve_extents, recursive::mtv, ...), exported directly. Following the directive would re-spell all of boost::numeric::ublas under detail (356 names, reachable from 15 modules, before #1). +numeric skip-directive boost::numeric::ublas::detail using boost::numeric::ublas -- boost/numeric/ublas/matrix.hpp and triangular.hpp open `namespace detail { using namespace boost::numeric::ublas; }` so the matrix_resize_preserve helpers can name uBLAS types unqualified. It is not a public spelling: every ublas::detail::X in Boost's headers, macros, tests and examples names a member declared in ublas::detail (tensor_expression, retrieve_extents, recursive::mtv, ...), exported directly. Following the directive would re-spell all of boost::numeric::ublas under detail (356 names, reachable from 15 modules, before #1). +numeric unreachable boost::mpl::advance -- 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. +numeric 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. +numeric unreachable boost::mpl::distance -- 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. +numeric 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. +numeric unreachable boost::mpl::next -- 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. +numeric unreachable boost::mpl::prior -- 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. pfr guard boost::pfr::detail::clang_wrapper_t if defined(__clang__) -- M9 platform guard: clang_wrapper_t is the clang-only NTTP wrapper (core_name20_static.hpp #ifdef __clang__ branch). pfr guard boost::pfr::detail::fields_count_dispatch_impl if BOOST_PFR_USE_CPP26_REFLECTION || BOOST_PFR_USE_CPP26 -- M9 platform guard: fields_count_dispatch_impl exists only under the C++26 reflection / structured-bindings branches (fields_count.hpp). poly_collection guard boost::mpl::item_by_order_impl if defined(__GNUC__) -- M9 platform guard: gcc-preprocessed mpl map headers only. -poly_collection skip-directive boost::poly_collection::common_impl -- boost/poly_collection/detail/poly_collection.hpp opens `namespace common_impl { using namespace detail; }` for its own implementation. common_impl is the base of base_collection / function_collection / any_collection / variant_collection, which are exported under boost::poly_collection; upstream spells common_impl::X only for common_impl::poly_collection itself. +poly_collection skip-directive boost::poly_collection::common_impl using boost::poly_collection::detail -- boost/poly_collection/detail/poly_collection.hpp opens `namespace common_impl { using namespace detail; }` for its own implementation. common_impl is the base of base_collection / function_collection / any_collection / variant_collection, which are exported under boost::poly_collection; upstream spells common_impl::X only for common_impl::poly_collection itself. +poly_collection 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. +poly_collection unreachable boost::mpl::contains_impl -- 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. +poly_collection 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. +poly_collection unreachable boost::mpl::next -- 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. +poly_collection unreachable boost::mpl::order_impl -- 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. process guard boost::asio::windows::basic_object_handle if defined(_WIN32) -- The boost::asio::windows handles that process's Windows launcher reaches (stream_handle, basic_object_handle) exist only on Windows. process guard boost::asio::windows::stream_handle if defined(_WIN32) -- The boost::asio::windows handles that process's Windows launcher reaches (stream_handle, basic_object_handle) exist only on Windows. process guard boost::process::v1::detail::windows::apply_out_handles if defined(_WIN32) -- M11 platform guard: v1 detail windows impls (incl. the NT workaround block below) are declared only by the windows GMF branches. @@ -628,10 +685,15 @@ process guard boost::process::v2::windows::with_token_launcher if defined(_WIN32 program_options guard boost::program_options::split_winmain if defined(_WIN32) -- M6 platform guard: winmain.hpp (split_winmain) is Windows-only. qvm guard boost::qvm::qvm_detail::vec_traits_gnuc_impl if defined(__GNUC__) && defined(__SSE2__) -- M12 platform guard: vec_traits_gnuc.hpp declares vec_traits_gnuc_impl only under __GNUC__ && __SSE2__ (gcc vector_size ext_vector_traits). range guard std::random_shuffle if defined(__GLIBCXX__) -- M9 platform guard: std::random_shuffle was removed in C++17; only libstdc++ (mingw/linux-gcc) still provides it. +serialization unreachable boost::mpl::always -- 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. +serialization 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. +serialization 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. signals2 guard boost::signals2::detail::critical_section if defined(BOOST_HAS_WINTHREADS) -- The critical-section mutex is the Windows-threads branch of signals2's lightweight mutex; POSIX uses pthread. signals2 guard boost::signals2::detail::critical_section_debug if defined(BOOST_HAS_WINTHREADS) -- The critical-section mutex is the Windows-threads branch of signals2's lightweight mutex; POSIX uses pthread. signals2 guard boost::signals2::detail::rtl_critical_section if defined(BOOST_HAS_WINTHREADS) -- The critical-section mutex is the Windows-threads branch of signals2's lightweight mutex; POSIX uses pthread. -sort skip-directive boost::sort::blk_detail -- boost/sort/block_indirect_sort/blk_detail/block.hpp opens `namespace blk_detail { using namespace boost::sort::common; }`: the implementation of block_indirect_sort uses the common range / stack helpers unqualified. The public entry point is boost::sort::block_indirect_sort; upstream spells blk_detail::X only for blk_detail's own templates (exported directly), and the common helpers keep their spelling boost::sort::common::X. Following the directive would re-spell boost::sort::common under blk_detail (55 names before #1). +sort skip-directive boost::sort::blk_detail using boost::sort::common -- boost/sort/block_indirect_sort/blk_detail/block.hpp opens `namespace blk_detail { using namespace boost::sort::common; }`: the implementation of block_indirect_sort uses the common range / stack helpers unqualified. The public entry point is boost::sort::block_indirect_sort; upstream spells blk_detail::X only for blk_detail's own templates (exported directly), and the common helpers keep their spelling boost::sort::common::X. Following the directive would re-spell boost::sort::common under blk_detail (55 names before #1). +statechart 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. +statechart 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. system guard boost::system::detail::local_free if defined(BOOST_WINDOWS_API) -- M6 platform guard: snapshot = mingw flavor; these boost/system/detail entities exist only under BOOST_WINDOWS_API (system_category_message_win32.hpp / condition). system guard boost::system::detail::message_cp_win32 if defined(BOOST_WINDOWS_API) -- M6 platform guard: snapshot = mingw flavor; these boost/system/detail entities exist only under BOOST_WINDOWS_API (system_category_message_win32.hpp / condition). system guard boost::system::detail::system_category_condition_win32 if defined(BOOST_WINDOWS_API) -- M6 platform guard: as above. @@ -743,6 +805,12 @@ 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 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. +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. +units unreachable boost::mpl::less_impl -- 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. url guard boost::urls::grammar::detail::find_if_not_pred if defined(BOOST_URL_USE_SSE2) -- M7 platform guard: charset.hpp defines the *_pred SSE2 helpers only under BOOST_URL_USE_SSE2 (x86 with SSE2); absent on arm64 (e.g. macOS). url guard boost::urls::grammar::detail::find_if_pred if defined(BOOST_URL_USE_SSE2) -- M7 platform guard: charset.hpp defines the *_pred SSE2 helpers only under BOOST_URL_USE_SSE2 (x86 with SSE2); absent on arm64 (e.g. macOS). utility drop boost::basic_string_ref -- Declared only via boost/utility/string_ref.hpp, which is left out of the module GMF (gcc 16.1 buffer_fill enum mismatch); consumers include the header. diff --git a/mcpp.toml b/mcpp.toml index 675517af..7673b98f 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -314,7 +314,7 @@ all-modules = { implies = ["optional", "variant", "variant2", "any", "core", "co implies = ["assert", "config", "core", "type-traits"] [features.variant] sources = ["src/variant.cppm"] - implies = ["assert", "config", "container-hash", "core", "integer", "throw-exception", "type-index", "type-traits"] + implies = ["assert", "config", "container-hash", "core", "integer", "throw-exception", "type-index", "type-traits", "utility"] [features.variant2] sources = ["src/variant2.cppm"] implies = ["assert", "mp11"] @@ -399,7 +399,7 @@ all-modules = { implies = ["optional", "variant", "variant2", "any", "core", "co implies = ["assert", "config", "core", "iterator", "move", "ptr-container", "type-traits"] [features.bimap] sources = ["src/bimap.cppm"] - implies = ["assert", "concept-check", "config", "core", "functional", "iterator", "lambda", "multi-index", "type-traits"] + implies = ["assert", "concept-check", "config", "core", "functional", "iterator", "lambda", "multi-index", "type-traits", "utility"] [features.bind] sources = ["src/bind.cppm"] implies = ["config", "core"] @@ -446,7 +446,7 @@ all-modules = { implies = ["optional", "variant", "variant2", "any", "core", "co implies = ["assert", "bind", "core"] [features.functional] sources = ["src/functional.cppm"] - implies = ["assert", "config", "container-hash", "core", "type-traits", "utility"] + implies = ["assert", "config", "container-hash", "core", "function", "type-traits", "utility"] [features.hash2] sources = ["src/hash2.cppm"] implies = ["assert", "config", "container-hash", "mp11"] @@ -604,7 +604,7 @@ all-modules = { implies = ["optional", "variant", "variant2", "any", "core", "co implies = ["assert", "config", "core", "dynamic-bitset", "integer", "io", "system", "type-traits"] [features.serialization] sources = ["src/serialization.cppm", "upstream/boost/libs/serialization/src/*.cpp"] - implies = ["array", "assert", "config", "core", "integer", "io", "iterator", "move", "optional", "smart-ptr", "throw-exception", "type-traits"] + implies = ["array", "assert", "config", "core", "integer", "io", "iterator", "move", "optional", "smart-ptr", "throw-exception", "type-traits", "utility"] [features.unit-test-framework] sources = ["upstream/boost/libs/test/src/compiler_log_formatter.cpp", "upstream/boost/libs/test/src/debug.cpp", "upstream/boost/libs/test/src/decorator.cpp", "upstream/boost/libs/test/src/execution_monitor.cpp", "upstream/boost/libs/test/src/framework.cpp", "upstream/boost/libs/test/src/junit_log_formatter.cpp", "upstream/boost/libs/test/src/plain_report_formatter.cpp", "upstream/boost/libs/test/src/progress_monitor.cpp", "upstream/boost/libs/test/src/results_collector.cpp", "upstream/boost/libs/test/src/results_reporter.cpp", "upstream/boost/libs/test/src/test_framework_init_observer.cpp", "upstream/boost/libs/test/src/test_tools.cpp", "upstream/boost/libs/test/src/test_tree.cpp", "upstream/boost/libs/test/src/unit_test_log.cpp", "upstream/boost/libs/test/src/unit_test_monitor.cpp", "upstream/boost/libs/test/src/unit_test_parameters.cpp", "upstream/boost/libs/test/src/xml_log_formatter.cpp", "upstream/boost/libs/test/src/xml_report_formatter.cpp"] implies = ["algorithm", "assert", "config", "core", "function", "iterator", "smart-ptr", "type-traits", "utility"] diff --git a/src/bimap.cppm b/src/bimap.cppm index bb53aea6..461d57fa 100644 --- a/src/bimap.cppm +++ b/src/bimap.cppm @@ -31,6 +31,7 @@ export import mcpplibs.mwrap.boost.iterator; export import mcpplibs.mwrap.boost.lambda; export import mcpplibs.mwrap.boost.multi_index; export import mcpplibs.mwrap.boost.type_traits; +export import mcpplibs.mwrap.boost.utility; #include "../generated/exports/bimap.inc" diff --git a/src/concept_check.cppm b/src/concept_check.cppm index 797c0dd3..ccae7132 100644 --- a/src/concept_check.cppm +++ b/src/concept_check.cppm @@ -1,6 +1,7 @@ // mcpplibs.mwrap.boost.concept_check — module facade over generated/exports/concept_check.inc // (hand-maintained; tools/gen_exports.py --check verifies its GMF include set) module; +#include #include #include #include diff --git a/src/functional.cppm b/src/functional.cppm index 5ad6f9da..82a7bb69 100644 --- a/src/functional.cppm +++ b/src/functional.cppm @@ -20,6 +20,7 @@ export import mcpplibs.mwrap.boost.assert; export import mcpplibs.mwrap.boost.config; export import mcpplibs.mwrap.boost.container_hash; export import mcpplibs.mwrap.boost.core; +export import mcpplibs.mwrap.boost.function; export import mcpplibs.mwrap.boost.type_traits; export import mcpplibs.mwrap.boost.utility; diff --git a/src/serialization.cppm b/src/serialization.cppm index 8df6a970..7d2a6e7e 100644 --- a/src/serialization.cppm +++ b/src/serialization.cppm @@ -78,6 +78,7 @@ export import mcpplibs.mwrap.boost.optional; export import mcpplibs.mwrap.boost.smart_ptr; export import mcpplibs.mwrap.boost.throw_exception; export import mcpplibs.mwrap.boost.type_traits; +export import mcpplibs.mwrap.boost.utility; #include "../generated/exports/serialization.inc" diff --git a/src/utility.cppm b/src/utility.cppm index c04a3730..9980399e 100644 --- a/src/utility.cppm +++ b/src/utility.cppm @@ -1,6 +1,7 @@ // mcpplibs.mwrap.boost.utility — module facade over generated/exports/utility.inc // (hand-maintained; tools/gen_exports.py --check verifies its GMF include set) module; +#include #include #include #include diff --git a/src/variant.cppm b/src/variant.cppm index 0c2523e1..8ff06629 100644 --- a/src/variant.cppm +++ b/src/variant.cppm @@ -15,6 +15,7 @@ export import mcpplibs.mwrap.boost.integer; export import mcpplibs.mwrap.boost.throw_exception; export import mcpplibs.mwrap.boost.type_index; export import mcpplibs.mwrap.boost.type_traits; +export import mcpplibs.mwrap.boost.utility; #include "../generated/exports/variant.inc" diff --git a/tests/concept_check.cpp b/tests/concept_check.cpp index 0c9b406f..c99080bd 100644 --- a/tests/concept_check.cpp +++ b/tests/concept_check.cpp @@ -13,5 +13,15 @@ int main() { boost::function_requires>(); boost::function_requires::iterator>>(); boost::function_requires::iterator>>(); + // boost/concept_archetype.hpp is Boost.ConceptCheck's: the archetypes the + // concept classes are checked against. + boost::function_requires>>(); + boost::function_requires>>(); + boost::function_requires>>(); + static_assert(std::is_base_of_v, + boost::assignable_archetype<>>); return 0; } diff --git a/tests/functional.cpp b/tests/functional.cpp index c1019b1d..193720c9 100644 --- a/tests/functional.cpp +++ b/tests/functional.cpp @@ -37,5 +37,12 @@ int main() { delete p; auto sp = boost::factory>()(7); assert(*sp == 7); + // overloaded_function takes its targets as boost::function, so the module + // brings that name too. + boost::function inc = [](int i) { return i + 1; }; + boost::function first = [](char const* s, int i) { return s[0] + i; }; + boost::overloaded_function both(inc, first); + assert(both(41) == 42); + assert(both("A", 1) == 'B'); return 0; } diff --git a/tests/regex/smoke.cpp b/tests/regex/smoke.cpp index 150ffce2..db690930 100644 --- a/tests/regex/smoke.cpp +++ b/tests/regex/smoke.cpp @@ -35,5 +35,11 @@ int main() { assert(boost::regex_search(s, mr, re)); assert(mr.prefix().length() == 0); assert(mr.suffix().str() == " and another@host.org"); + + // boost/regex/concepts.hpp spells its traits archetype's locale_type with + // these; they come from mcpplibs.mwrap.boost.concept_check. + static_assert(std::is_base_of_v< + boost::null_archetype<>, + boost::copy_constructible_archetype>>); return 0; } diff --git a/tests/utility.cpp b/tests/utility.cpp index 951c916e..eb0f6145 100644 --- a/tests/utility.cpp +++ b/tests/utility.cpp @@ -15,5 +15,9 @@ int main() { boost::string_view sv2 = boost::string_view("abc").substr(1); assert(sv2 == "bc"); assert(boost::string_view("a") < boost::string_view("b")); + static_assert(std::is_same_v::param_type, int const>); + static_assert(std::is_same_v::param_type, + std::string const&>); + static_assert(std::is_same_v::reference, int&>); return 0; } diff --git a/tests/variant.cpp b/tests/variant.cpp index 24e36f96..c3d2e2ea 100644 --- a/tests/variant.cpp +++ b/tests/variant.cpp @@ -31,5 +31,8 @@ int main() { } boost::variant only(1); assert(boost::get(only) == 1); + // variant's converting initializers are declared with call_traits, which + // the module gets from mcpplibs.mwrap.boost.utility. + static_assert(std::is_same_v::param_type, int const>); return 0; } diff --git a/tools/boost_common.py b/tools/boost_common.py index 6a39ba50..ce874436 100644 --- a/tools/boost_common.py +++ b/tools/boost_common.py @@ -194,6 +194,13 @@ def _boost_version(): # boost/core/detail/string_view.hpp; without it no module exported the # string_view alias, which charconv's from_chars(string_view) overloads # take (only json exported basic_string_view, reached through its own GMF). +# - concept_check: boost/concept_archetype.hpp is documented by +# Boost.ConceptCheck, but no other rule gives it an owner, so the first +# library to include it (iterator) claimed the archetypes: concept_check +# did not export them, and regex, whose traits archetype is spelled with +# them and which does not depend on iterator, could not reach them. +# - utility: boost/call_traits.hpp is documented by Boost.Utility; the same +# way, variant had call_traits and utility did not. # - smart_ptr: boost/pointer_cast.hpp is smart_ptr's (upstream: # Boost::conversion links Boost::smart_ptr for it) and declares the raw # pointer / std::unique_ptr / std::shared_ptr overloads of @@ -206,14 +213,18 @@ def _boost_version(): # the file stays out of the owner's header set, so the owner's GMF and # export list do not change. Filled from the top-level EXTRA_HEADERS # entries; a file whose declarations a module must export belongs in -# EXTRA_HEADERS, not here. +# EXTRA_HEADERS, not here. boost/detail/call_traits.hpp, which only +# boost/call_traits.hpp includes, holds that header's definitions, and +# ownership follows the definition. EXTRA_HEADERS = { + "concept_check": ["concept_archetype.hpp"], "conversion": ["implicit_cast.hpp", "polymorphic_cast.hpp", "polymorphic_pointer_cast.hpp"], "core": ["core/detail/string_view.hpp"], "smart_ptr": ["pointer_cast.hpp"], + "utility": ["call_traits.hpp"], } -TOP_LEVEL_OWNERS = {} +TOP_LEVEL_OWNERS = {"detail/call_traits.hpp": "utility"} for _lib, _names in EXTRA_HEADERS.items(): for _name in _names: if "/" not in _name: diff --git a/tools/ci/check_reachable.py b/tools/ci/check_reachable.py new file mode 100644 index 00000000..f8acedf8 --- /dev/null +++ b/tools/ci/check_reachable.py @@ -0,0 +1,298 @@ +#!/usr/bin/env python3 +"""Check that no module silently lost a name its importers could spell. + +`gen_exports.py --check` proves that the committed export lists are what the +generator writes; it cannot see that a generator, policy or import change made +a name disappear. This check compares, per module, the names an importer can +reach: the module's own generated/exports/.inc plus those of every module +it `export import`s, transitively (read from src/.cppm). A pair (module, +name) reachable at a baseline and not in the working tree must be explained in +generated/meta/skipped.txt, the record of the export policy's decisions: + + drop the policy drops the export + unreachable the policy's [[unreachable]] says why + skip-directive using , ... + explains ::X while the module still + reaches ::X: the spelling + through the directive is all that went + +An entry speaks for its own module only. A module that merely imported the +name is covered by the entry of the module it came from, but one that exported +the name itself, or that no longer imports a module which still has it, needs +its own entry (`flyweight drop X` does not explain why heap lost X). + +Two baselines are compared: BASELINE below, so the losses already accounted +for stay accounted for, and --base (CI: the pull request's merge base or the +push's previous head), so a name added after BASELINE cannot be lost either. + +Not seen: names declared in src/*.cppm itself, the signatures behind a name, +and the preprocessor condition of an export (a `#if` in an .inc counts as +exported; every guard has its own skipped.txt line). + +Usage: + python3 tools/ci/check_reachable.py [--base ] +""" + +import argparse +import re +import subprocess +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +MODULE_PREFIX = "mcpplibs.mwrap.boost." +SKIPPED = "generated/meta/skipped.txt" + +# main before #1 (Boost 1.92.0), the surface issue #2 was measured against. +# A Boost upgrade removes names upstream removed: move BASELINE to the last +# commit before the upgrade, declare what the upgrade removes, and move it to +# the upgrade's own commit afterwards, dropping the entries it made moot. +BASELINE = "99533232d06ea492303f10133d7609dffd53893c" + +# {module: reason} of facades removed on purpose since BASELINE. +REMOVED_MODULES = {} + + +# --------------------------------------------------------------------------- +# reading a tree: the working tree (rev None) or a revision +# --------------------------------------------------------------------------- + +def _git(*args, stdin=None): + result = subprocess.run(["git", *args], cwd=ROOT, input=stdin, + capture_output=True, check=False) + if result.returncode != 0: + raise SystemExit("git {} failed: {}".format( + " ".join(args), result.stderr.decode("utf-8", "replace").strip())) + return result.stdout + + +def read_tree(rev): + """{path: text} of the export lists and facades at a revision.""" + if rev is None: + files = [*(ROOT / "generated" / "exports").glob("*.inc"), + *(ROOT / "src").glob("*.cppm")] + return {p.relative_to(ROOT).as_posix(): + p.read_text(encoding="utf-8") for p in files} + listing = _git("ls-tree", "-r", "--name-only", rev, "--", + "generated/exports", "src").decode() + paths = [p for p in listing.splitlines() + if (p.startswith("generated/exports/") and p.endswith(".inc")) + or (p.startswith("src/") and p.endswith(".cppm"))] + blob = _git("cat-file", "--batch", stdin="".join( + "{}:{}\n".format(rev, p) for p in paths).encode()) + out, pos = {}, 0 + for p in paths: + eol = blob.index(b"\n", pos) + size = int(blob[pos:eol].split()[2]) + out[p] = blob[eol + 1:eol + 1 + size].decode("utf-8") + pos = eol + 1 + size + 1 + return out + + +# --------------------------------------------------------------------------- +# the reachable surface +# --------------------------------------------------------------------------- + +_NAMESPACE = re.compile(r"namespace\s+(?:inline\s+)?([\w:]+)\s*\{") +_USING = re.compile(r"(?:export\s+)?using\s+(?!namespace\b)([^;]+);") +_NS_ALIAS = re.compile(r"namespace\s+(\w+)\s*=") +_EXPORT_IMPORT = re.compile(r"^\s*export\s+import\s+([\w.]+)\s*;", re.MULTILINE) + + +def _last_segment(target): + """`boost::a::b` -> b, `boost::operator==` -> operator==, + `b = ::boost::c` -> b.""" + at = re.search(r"(? action + self.directives = {} # lib -> {namespace: [target, ...]} + for line in text.splitlines(): + if not line or line.startswith("#"): + continue + head = line.partition(" -- ")[0] + lib, action, rest = head.split(" ", 2) + if action in ("drop", "unreachable"): + self.names[lib, rest] = action + elif action == "skip-directive": + ns, _, targets = rest.partition(" using ") + self.directives.setdefault(lib, {})[ns] = \ + [t.strip() for t in targets.split(",") if t.strip()] + + def explains(self, lib, name, surface): + if (lib, name) in self.names: + return True + reach = surface.reach.get(lib, ()) + for ns, targets in self.directives.get(lib, {}).items(): + if not name.startswith(ns + "::"): + continue + rest = name[len(ns) + 2:] + if any(t + "::" + rest in reach for t in targets): + return True + return False + + def stale(self, surface): + """`unreachable` entries the tree contradicts.""" + out = [] + for (lib, name), action in sorted(self.names.items()): + if action != "unreachable": + continue + if lib not in surface.reach: + out.append("{}: no such module".format(lib)) + elif name in surface.reach[lib]: + out.append("{} reaches {}".format(lib, name)) + return out + + +def unexplained(base, now, explanations, removed=()): + """[(module, name, why)] of the losses nothing explains. `why` is "" + when the module exported the name itself, else the import it came by.""" + out = [] + for lib in sorted(base.reach): + if lib not in now.reach: + if lib not in removed: + out.append((lib, "", "the module is gone")) + continue + for name in sorted(base.reach[lib] - now.reach[lib]): + # A name inherited only from imports that lost it too is reported + # for (or explained by) those modules. + why = None + if name in base.own.get(lib, ()): + why = "" + else: + for dep in sorted(base.imports[lib]): + if name not in base.reach.get(dep, ()): + continue + if dep not in now.reach: + why = "came from {}, which is gone".format(dep) + elif name in now.reach[dep]: + why = "{} still has it but is no longer imported" \ + .format(dep) + else: + continue + break + if why is not None and not explanations.explains(lib, name, now): + out.append((lib, name, why)) + return out + + +# --------------------------------------------------------------------------- + +def main(): + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("--base", help="also compare with this revision") + args = parser.parse_args() + + now = Surface(read_tree(None)) + explanations = Explanations((ROOT / SKIPPED).read_text(encoding="utf-8")) + failed = False + + for rev in dict.fromkeys(r for r in (BASELINE, args.base) if r): + known = subprocess.run( + ["git", "cat-file", "-e", rev + "^{commit}"], cwd=ROOT, + capture_output=True, check=False) + if known.returncode != 0: + print("error: baseline {} is not in this clone; fetch the full " + "history".format(rev), file=sys.stderr) + return 1 + base = Surface(read_tree(rev)) + lost = unexplained(base, now, explanations, REMOVED_MODULES) + total = sum(len(base.reach[lib] - now.reach[lib]) + for lib in base.reach if lib in now.reach) + print("{}: {} modules, {} (module, name) pairs no longer reachable, " + "{} unexplained".format(rev[:12], len(base.reach), total, + len(lost)), flush=True) + for lib, name, why in lost: + failed = True + print(" lost: {}{}{}".format( + lib, " " + name if name else "", + " ({})".format(why) if why else ""), file=sys.stderr) + + for problem in explanations.stale(now): + failed = True + print(" stale unreachable entry: " + problem, file=sys.stderr) + + if failed: + print("\ncheck_reachable: restore each lost name, or declare it in " + "tools/export_policy.toml ([[unreachable]], with the reason) " + "and regenerate; delete stale entries", file=sys.stderr) + return 1 + print("check_reachable: every lost name is explained in " + SKIPPED) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/ci/verify_generated.py b/tools/ci/verify_generated.py index 7814df9e..1463ccf1 100644 --- a/tools/ci/verify_generated.py +++ b/tools/ci/verify_generated.py @@ -6,6 +6,9 @@ byte for byte without touching the tree (``gen_exports.py --check``, ``gen_features.py --check``); this driver runs them from a clean checkout and finally asserts that no step modified tracked files or left untracked ones. +``ci/check_reachable.py`` then compares the names each module's importers reach +with the CI base, because byte-identical output can still be output that lost +names. ``import_boost.py`` is different from the other steps. Re-vendoring restores the upstream files under ``upstream/boost/`` and intentionally removes the @@ -83,8 +86,9 @@ def _revision_exists(revision): return git("rev-parse", "--verify", revision).returncode == 0 -def _changed_since_base(path): - """Return whether *path* changed in the current CI revision range.""" +def _base_revisions(): + """The CI base of this run that exists in the clone: the pull request's + target branch or the push's previous head.""" event = os.environ.get("GITHUB_EVENT_NAME", "") revisions = [] @@ -97,11 +101,26 @@ def _changed_since_base(path): if before and set(before) != {"0"}: revisions.append(before) - for base in revisions: - if _revision_exists("{}^{{commit}}".format(base)): - names = git_text("diff", "--name-only", "{}...HEAD".format(base), "--", path) - if names is not None: - return bool(names.strip()) + return [r for r in revisions + if _revision_exists("{}^{{commit}}".format(r))] + + +def _merge_base(): + """Commit the current changes started from: the merge base with the CI + base, locally with origin/main; None when neither is known.""" + for base in _base_revisions() or ["origin/main"]: + rev = git_text("merge-base", base, "HEAD") + if rev and rev.strip(): + return rev.strip() + return None + + +def _changed_since_base(path): + """Return whether *path* changed in the current CI revision range.""" + for base in _base_revisions(): + names = git_text("diff", "--name-only", "{}...HEAD".format(base), "--", path) + if names is not None: + return bool(names.strip()) # Local runs and unusual GitHub events do not always provide a base ref. # HEAD^ is still a useful and deterministic fallback for the normal case. @@ -151,6 +170,10 @@ def main(): run_step("fetch_mingw_sysroot.py") run_step("apply_patches.py") run_step("gen_exports.py", "--check") + # --check proves the lists current; this proves none of them silently + # lost a name importers could spell. + base = _merge_base() + run_step("ci/check_reachable.py", *(["--base", base] if base else [])) run_step("gen_features.py", "--check") run_step("gen_audit.py") run_step("gen_audit.py", "--macros") diff --git a/tools/export_policy.toml b/tools/export_policy.toml index 4a6f82d7..ca73b7dc 100644 --- a/tools/export_policy.toml +++ b/tools/export_policy.toml @@ -24,6 +24,10 @@ # target library owns; every name that library exports # directly in is re-exported through it # [.deps] add = [...], remove = [...], reason = "..." +# [[unreachable]] reason = "...", names = {"" = ["", ...]} — +# names importers of those modules could once spell and no +# longer can; tools/ci/check_reachable.py requires an entry +# for each and rejects one for a name the module reaches # # A `names` entry with `::` matches one qualified name exactly; a bare # identifier matches any `::` segment of an exported name. @@ -448,6 +452,20 @@ it when it is processed before poly_collection. """ names = ["boost::mpl::item_by_order_impl"] +[functional.deps] +# boost::overloaded_function takes its targets as boost::function +# (overloaded_function_detail::base's constructor parameter). The classes that +# spell it are partial specializations and the include sits in the library's +# own detail/ headers, so neither the signature closure nor the include edges +# see it; upstream's CMake links Boost::function. +add = ["function"] + +[variant.deps] +# boost/variant/detail/initializer.hpp uses boost::call_traits, which +# Boost.Utility owns; the include sits in the library's own detail/ headers, +# which the include edges do not read. Upstream's CMake links Boost::utility. +add = ["utility"] + [version.deps] # Hand-written module (src/version.cppm): the thin entry re-exports the macro # mapping module, where the constants live (one export owner). @@ -2683,3 +2701,106 @@ names = [ "boost::mpl::aux::template_arity_impl", ] +# -------------------------------------------------------------------------- +# names modules no longer reach (tools/ci/check_reachable.py) + +[[unreachable]] +reason = ''' +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. +''' +[unreachable.names] +"boost::mpl::advance" = ["functional", "iterator", "numeric"] +"boost::mpl::always" = ["serialization"] +"boost::mpl::aux::template_arity" = [ + "accumulators", "bimap", "contract", "functional", "iterator", "numeric", + "poly_collection", "serialization", "statechart", "type_erasure", "units", +] +"boost::mpl::aux::type_wrapper" = ["functional"] +"boost::mpl::contains_impl" = ["poly_collection"] +"boost::mpl::deref" = ["units"] +"boost::mpl::distance" = ["functional", "iterator", "numeric"] +"boost::mpl::identity" = ["graph"] +"boost::mpl::insert" = ["accumulators"] +"boost::mpl::lambda" = [ + "accumulators", "bimap", "contract", "functional", "heap", "iterator", + "numeric", "poly_collection", "serialization", "statechart", + "type_erasure", "units", +] +"boost::mpl::less_impl" = ["units"] +"boost::mpl::next" = ["functional", "iterator", "numeric", "poly_collection"] +"boost::mpl::order_impl" = ["poly_collection"] +"boost::mpl::pop_front" = ["iterator"] +"boost::mpl::prior" = ["functional", "iterator", "numeric"] +"boost::mpl::vector" = ["bimap"] + +[[unreachable]] +reason = ''' +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. +''' +[unreachable.names] +"boost::parameter::keyword" = ["accumulators", "graph"] +"boost::parameter::optional" = ["heap", "lockfree"] +"boost::parameter::parameters" = ["graph", "heap", "lockfree"] +"boost::parameter::required" = ["graph", "heap"] + +[[unreachable]] +reason = ''' +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. +''' +[unreachable.names] +"boost::fusion::deque" = ["hana"] + +[[unreachable]] +reason = ''' +An implementation detail of Boost.Container +(boost/container/detail/transform_iterator.hpp) that +boost/interprocess/detail/transform_iterator.hpp names by using-declaration. +The generator before #1 exported the target instead of the name the +declaration publishes, boost::interprocess::X, which the module now has. +''' +[unreachable.names] +"boost::container::make_transform_iterator" = ["interprocess"] +"boost::container::transform_iterator" = ["interprocess"] + +[[unreachable]] +reason = ''' +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). +''' +[unreachable.names] +"boost::cobalt::main" = ["cobalt"] +"boost::cobalt::detail::main_promise" = ["cobalt"] +"boost::cobalt::detail::signal_helper" = ["cobalt"] + +[[unreachable]] +reason = ''' +Declared or included by boost/geometry/geometries/adapted/boost_fusion.hpp +alone, which the module does not include: in its global module fragment the +Fusion adaptation and the boost::tuple adaptation match the same types. A +program that adapts Fusion sequences includes the header itself, before the +import (docs/usage.md §6, tests/geometry/examples_core_geometries_6.cpp). +''' +[unreachable.names] +"boost::geometry::fusion_adapt_detail::all_same" = ["geometry"] +"boost::geometry::fusion_adapt_detail::is_coordinate_size" = ["geometry"] +"boost::geometry::fusion_adapt_detail::is_fusion_sequence" = ["geometry"] +"boost::mpl::aux::next_if" = ["geometry"] +"boost::mpl::count_if" = ["geometry"] diff --git a/tools/gen_exports.py b/tools/gen_exports.py index 8a529b98..482695d0 100644 --- a/tools/gen_exports.py +++ b/tools/gen_exports.py @@ -98,6 +98,9 @@ class Policy: [.deps] add / remove / reason — module edge corrections [.facade] omit-imports / reason — .deps edges src/.cppm cannot `export import` (checked by check_facade) + [[unreachable]] reason / names = {name: [lib, ...]} — names an + importer of those modules could once spell and no + longer can (checked by tools/ci/check_reachable.py) A `names` entry containing `::` matches a qualified name exactly; a bare identifier matches any `::` segment of the exported name. @@ -152,6 +155,9 @@ def facade_includes(self, lib): def facade_omit_imports(self, lib): return list(self.lib(lib).get("facade", {}).get("omit-imports", ())) + def unreachable(self): + return list(self.data.get("unreachable", ())) + def digest(self, lib): return hashlib.sha256(json.dumps( self.lib(lib), sort_keys=True).encode()).hexdigest() @@ -845,9 +851,9 @@ def check_skipped_directives(lib, m, policy): `skip-directive` with the reason it is not one, so no spelling is lost silently. - Returns (skipped entries, errors): an undeclared directive, a - `skip-directive` that matches none, and one that is also a `republish` - are errors.""" + Returns (skipped entries, errors): an entry carries the namespaces its + directives name; an undeclared directive, a `skip-directive` that matches + none, and one that is also a `republish` are errors.""" found = {} for d in m.indexed(): if d.kind != "UsingDirectiveDecl" or d.parent is None \ @@ -865,7 +871,9 @@ def check_skipped_directives(lib, m, policy): for entry in policy.skip_directives(lib): where = entry["namespace"] declared.add(where) - entries.append((lib, "skip-directive", where, "", entry["reason"])) + entries.append((lib, "skip-directive", where, + ", ".join(sorted(found.get(where, ()))), + entry["reason"])) if where in republished: errors.append("policy skip-directive {}: the namespace is also a " "republish".format(where)) @@ -1262,7 +1270,10 @@ def emit_inc(lib, records, out_dir, claimed, policy, extra_deps=(), or any(q.startswith(n + "::") for n in r.get("namespaces", ()))), None) if rule is not None: - skipped.append((lib, "drop", q, "", rule["reason"])) + # The spelling an importer loses: core drops `std::size`, which + # its header injects as boost::size. + skipped.append((lib, "drop", "::".join( + ns + [q.rsplit("::", 1)[-1]]), "", rule["reason"])) continue if "guard" in rec: guard = rec["guard"] @@ -1410,6 +1421,30 @@ def check_facade(lib, gfm_headers, extra_includes=(), deps=(), return problems +def unreachable_entries(policy, libs): + """(skipped entries, errors) of the policy `unreachable` rules: names a + module's importers could once spell and no longer can, with the reason. + Whether an entry is still true is not decided here (that takes the whole + import graph): tools/ci/check_reachable.py rejects an entry for a name + the module does reach.""" + entries, errors, seen = [], [], set() + for rule in policy.unreachable(): + reason = rule.get("reason", "").strip() + if not reason: + errors.append("policy unreachable: an entry has no reason") + for name, mods in sorted(rule.get("names", {}).items()): + for lib in mods: + if lib not in libs: + errors.append("policy unreachable {}: unknown library " + "'{}'".format(name, lib)) + if (lib, name) in seen: + errors.append("policy unreachable {}: '{}' is listed " + "twice".format(name, lib)) + seen.add((lib, name)) + entries.append((lib, "unreachable", name, "", reason)) + return entries, errors + + def write_meta(out_dir, summary, skipped): """generated/meta/api-surface.json + skipped.txt (sorted, no paths, no timestamps — byte-stable for --check).""" @@ -1430,17 +1465,20 @@ def write_meta(out_dir, summary, skipped): json.dumps(surface, indent=1, sort_keys=True) + "\n", encoding="utf-8", newline="\n") lines = [ - "# Names the export policy (tools/export_policy.toml) guards, drops or", - "# adds verbatim, and the using-directives it does not follow.", + "# Names the export policy (tools/export_policy.toml) guards, drops,", + "# adds verbatim or declares unreachable, and the using-directives it", + "# does not follow. tools/ci/check_reachable.py reads this file.", "# GENERATED by tools/gen_exports.py - DO NOT EDIT", "# [if ] -- ", + "# skip-directive using , ... -- ", "", ] for lib, action, name, cond, reason in sorted(set(skipped)): cond = " ".join(cond.split()) + if cond: + cond = " {} {}".format(_cond_word(action), cond) lines.append("{} {} {}{} -- {}".format( - lib, action, name, " if " + cond if cond else "", - " ".join(reason.split()))) + lib, action, name, cond, " ".join(reason.split()))) (meta / "skipped.txt").write_text("\n".join(lines) + "\n", encoding="utf-8", newline="\n") @@ -1732,12 +1770,18 @@ def generate(args, out): lib_keys[lib] = None if uk is None else _skip_key( lib, gfm_memo[lib], uk, args.no_body_deps, policy) + skipped, errors = unreachable_entries(policy, bc.TARGET_LIBS) + if errors: + for e in errors: + print("error: {}".format(e), file=sys.stderr) + return 1, [] + old_surface = _load_json(out / "generated" / "meta" / "api-surface.json") old_libs = (old_surface or {}).get("libraries", {}) old_skipped = _read_skipped(out / "generated" / "meta" / "skipped.txt") claimed, claimed_inject, published = {}, {}, {} - summary, skipped, body_all, gfm_by_lib, deps_by_lib = {}, [], {}, {}, {} + summary, body_all, gfm_by_lib, deps_by_lib = {}, {}, {}, {} cache_payloads = {} for lib in order: if lib in bc.LIBS_SPECIAL: @@ -1754,7 +1798,8 @@ def generate(args, out): # shape first-wins ownership downstream, so replay them. if lib in old_libs: summary[lib] = old_libs[lib] - skipped += [e for e in old_skipped if e[0] == lib] + skipped += [e for e in old_skipped + if e[0] == lib and e[1] != "unreachable"] if hit: for usr, owner in sk["claims"]: claimed.setdefault(usr, owner) @@ -1921,6 +1966,10 @@ def generate(args, out): return 0, problems +def _cond_word(action): + return "using" if action == "skip-directive" else "if" + + def _read_skipped(path): """Committed skipped.txt entries (kept for libraries not regenerated).""" out = [] @@ -1935,8 +1984,9 @@ def _read_skipped(path): continue lib, action, name = parts[:3] cond = "" - if len(parts) == 4 and parts[3].startswith("if "): - cond = parts[3][3:] + word = _cond_word(action) + " " + if len(parts) == 4 and parts[3].startswith(word): + cond = parts[3][len(word):] out.append((lib, action, name, cond, reason)) return out diff --git a/tools/tests/test_check_reachable.py b/tools/tests/test_check_reachable.py new file mode 100644 index 00000000..f377eabc --- /dev/null +++ b/tools/tests/test_check_reachable.py @@ -0,0 +1,218 @@ +"""tools/ci/check_reachable.py: a name an importer could spell may only go +with an explanation in skipped.txt.""" +import sys +import unittest +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "ci")) + +import check_reachable as cr + + +def inc(*names): + """An export list as the generator writes it.""" + lines = ["// GENERATED by tools/gen_exports.py - DO NOT EDIT", ""] + for name in names: + ns, _, last = name.rpartition("::") + lines += ["export " + " ".join("namespace {} {{".format(n) + for n in ns.split("::")), + " using {}::{};".format(ns, last), + "}" * (ns.count("::") + 1), ""] + return "\n".join(lines) + + +def cppm(lib, *imports): + return "module;\n#include \nexport module {1}{0};\n{2}".format( + lib, cr.MODULE_PREFIX, "".join( + "export import {}{};\n".format(cr.MODULE_PREFIX, i) + for i in imports)) + + +def surface(**libs): + """surface(heap=(["boost::x"], ["core"])): own names, imports.""" + tree = {} + for lib, (names, imports) in libs.items(): + tree["generated/exports/{}.inc".format(lib)] = inc(*names) + tree["src/{}.cppm".format(lib)] = cppm(lib, *imports) + return cr.Surface(tree) + + +class ExportedNamesTests(unittest.TestCase): + def test_declarations(self): + text = "\n".join([ + "export namespace boost { namespace dll {", + "#if defined(_WIN32)", + " // using boost::dll::commented;", + " using boost::dll::load;", + "#endif", + " using ::boost::filesystem::path;", + " using boost::dll::operator==;", + " using boost::dll::operator<<;", + " using boost::dll::operator new;", + " using boost::dll::operators;", + " using alias = ::boost::other::thing;", + " namespace errc = ::boost::system::errc;", + " using namespace boost::other;", + "}}", + "", + "export {", + " using ::boost_container_new_t;", + "}", + "export namespace boost::asio {", + " using boost::asio::any;", + "}", + "using boost::outside;", + ]) + self.assertEqual(cr.exported_names(text), { + "boost::dll::load", "boost::dll::path", + "boost::dll::operator==", "boost::dll::operator<<", + "boost::dll::operator new", "boost::dll::operators", + "boost::dll::alias", "boost::dll::errc", + "boost_container_new_t", "boost::asio::any"}) + + +class SurfaceTests(unittest.TestCase): + def test_reach_is_transitive(self): + s = surface(core=(["boost::a"], []), range=(["boost::b"], ["core"]), + algorithm=([], ["range"])) + self.assertEqual(s.reach["algorithm"], {"boost::a", "boost::b"}) + self.assertEqual(s.reach["core"], {"boost::a"}) + + def test_only_module_purview_imports_count(self): + s = cr.Surface({ + "generated/exports/a.inc": inc("boost::x"), + "src/a.cppm": cppm("a"), + "src/b.cppm": "module;\n// export import mcpplibs.mwrap.boost.a;\n" + "export module mcpplibs.mwrap.boost.b;\n" + "import mcpplibs.mwrap.boost.a;\n" + "export import std;\n"}) + self.assertEqual(s.reach["b"], set()) + + +class UnexplainedTests(unittest.TestCase): + def lost(self, base, now, skipped="", removed=()): + return cr.unexplained(base, now, cr.Explanations(skipped), removed) + + def test_unchanged_and_moved_names_are_not_lost(self): + base = surface(core=([], []), utility=(["boost::call_traits"], ["core"])) + now = surface(core=(["boost::call_traits"], []), + utility=([], ["core"])) + self.assertEqual(self.lost(base, base), []) + self.assertEqual(self.lost(base, now), []) + + def test_lost_name_is_reported_where_it_was_exported(self): + base = surface(core=(["boost::size"], []), range=([], ["core"]), + algorithm=([], ["range"])) + now = surface(core=([], []), range=([], ["core"]), + algorithm=([], ["range"])) + self.assertEqual(self.lost(base, now), [("core", "boost::size", "")]) + # The owner's entry covers the modules that only imported the name. + for action in ("drop", "unreachable"): + entry = "core {} boost::size -- ambiguous with range".format(action) + self.assertEqual(self.lost(base, now, entry), []) + + def test_another_modules_entry_does_not_explain(self): + # flyweight's drop says nothing about heap, which exported the name + # itself. + base = surface(heap=(["boost::parameter::optional"], []), + flyweight=([], [])) + now = surface(heap=([], []), flyweight=([], [])) + lost = self.lost( + base, now, "flyweight drop boost::parameter::optional -- shared") + self.assertEqual(lost, [("heap", "boost::parameter::optional", "")]) + + def test_names_are_matched_whole(self): + base = surface(core=(["boost::size", "boost::sized"], [])) + now = surface(core=([], [])) + lost = self.lost(base, now, "core drop boost::size -- r") + self.assertEqual(lost, [("core", "boost::sized", "")]) + + def test_guards_and_extras_explain_nothing(self): + base = surface(core=(["boost::a"], [])) + now = surface(core=([], [])) + for entry in ("core guard boost::a if defined(_WIN32) -- r", + "core extra boost::a -- r", + "core republish boost::a -- r"): + self.assertEqual(self.lost(base, now, entry), + [("core", "boost::a", "")]) + + def test_dropped_import_is_reported_at_the_importer(self): + base = surface(function=(["boost::function"], []), + functional=([], ["function"]), + bimap=([], ["functional"])) + now = surface(function=(["boost::function"], []), functional=([], []), + bimap=([], ["functional"])) + lost = self.lost(base, now) + self.assertEqual([x[:2] for x in lost], + [("functional", "boost::function")]) + self.assertIn("function still has it", lost[0][2]) + + def test_name_covered_through_another_import_needs_no_entry(self): + base = surface(a=(["boost::x"], []), b=(["boost::y"], ["a"]), + c=([], ["a", "b"])) + now = surface(a=(["boost::x"], []), b=(["boost::y"], ["a"]), + c=([], ["b"])) + self.assertEqual(self.lost(base, now), []) + + def test_removed_module(self): + base = surface(a=(["boost::x"], []), b=([], ["a"])) + now = surface(b=([], [])) + self.assertEqual(self.lost(base, now), [ + ("a", "", "the module is gone"), + ("b", "boost::x", "came from a, which is gone")]) + # Declaring the removal still leaves its importers to explain. + self.assertEqual(self.lost(base, now, removed={"a": "reason"}), [ + ("b", "boost::x", "came from a, which is gone")]) + + +class SkipDirectiveTests(unittest.TestCase): + ENTRY = ("numeric skip-directive boost::ublas::detail using " + "boost::other, boost::ublas -- resize helpers") + + def setUp(self): + self.base = surface(numeric=(["boost::ublas::matrix", + "boost::ublas::detail::matrix", + "boost::ublas::detail::own", + "boost::ublas::detail::operator=="], + [])) + + def lost(self, now, entry=ENTRY): + return cr.unexplained(self.base, now, cr.Explanations(entry)) + + def test_explains_the_spelling_through_the_directive_only(self): + now = surface(numeric=(["boost::ublas::matrix", + "boost::ublas::operator=="], [])) + # A name the detail namespace declared itself did not come through + # the directive. + self.assertEqual(self.lost(now), [ + ("numeric", "boost::ublas::detail::own", "")]) + + def test_does_not_explain_a_name_lost_in_the_target_too(self): + now = surface(numeric=(["boost::ublas::detail::own", + "boost::ublas::operator=="], [])) + self.assertEqual(self.lost(now), [ + ("numeric", "boost::ublas::detail::matrix", ""), + ("numeric", "boost::ublas::matrix", "")]) + + def test_does_not_explain_without_targets(self): + now = surface(numeric=(["boost::ublas::matrix"], [])) + entry = "numeric skip-directive boost::ublas::detail -- r" + self.assertEqual(len(self.lost(now, entry)), 3) + + +class StaleTests(unittest.TestCase): + def test_entry_for_a_reachable_name_is_stale(self): + now = surface(core=(["boost::a"], []), range=([], ["core"])) + stale = cr.Explanations("\n".join([ + "# comment", "", + "range unreachable boost::a -- r", + "range unreachable boost::b -- r", + "gone unreachable boost::a -- r", + "core drop boost::a -- r", + ])).stale(now) + self.assertEqual(stale, ["gone: no such module", + "range reaches boost::a"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/tests/test_gen_exports_skip_directive.py b/tools/tests/test_gen_exports_skip_directive.py index 34fa3add..8ade39bb 100644 --- a/tools/tests/test_gen_exports_skip_directive.py +++ b/tools/tests/test_gen_exports_skip_directive.py @@ -91,7 +91,9 @@ def test_undeclared_directive_is_an_error(self): def test_declared_directive_is_listed_with_its_reason(self): entries, errors = self.check(policy(**{"skip-directive": [SKIP]})) self.assertEqual(errors, []) - self.assertEqual(entries, [("numeric", "skip-directive", NS, "", + # ... and the namespace the directive names (check_reachable.py). + self.assertEqual(entries, [("numeric", "skip-directive", NS, + "boost::numeric::ublas", "resize helpers")]) def test_republish_declares_the_directive(self): diff --git a/tools/tests/test_gen_exports_unreachable.py b/tools/tests/test_gen_exports_unreachable.py new file mode 100644 index 00000000..1dce02cd --- /dev/null +++ b/tools/tests/test_gen_exports_unreachable.py @@ -0,0 +1,70 @@ +"""Policy `unreachable`: the names importers can no longer spell, listed in +skipped.txt for tools/ci/check_reachable.py.""" +import tempfile +import unittest +from pathlib import Path + +import gen_exports + +RULE = {"reason": "MPL is\ninclude-only.", + "names": {"boost::mpl::lambda": ["heap", "units"], + "boost::mpl::always": ["heap"]}} + + +def run(*rules): + return gen_exports.unreachable_entries( + gen_exports.Policy({"unreachable": list(rules)}), ["heap", "units"]) + + +class UnreachableTests(unittest.TestCase): + def test_one_entry_per_module_and_name(self): + entries, errors = run(RULE) + self.assertEqual(errors, []) + self.assertEqual([e[:4] for e in entries], [ + ("heap", "unreachable", "boost::mpl::always", ""), + ("heap", "unreachable", "boost::mpl::lambda", ""), + ("units", "unreachable", "boost::mpl::lambda", "")]) + + def test_no_rules(self): + self.assertEqual( + gen_exports.unreachable_entries(gen_exports.Policy({}), ["heap"]), + ([], [])) + + def test_errors(self): + for rule, message in ( + ({"names": {"boost::a": ["heap"]}}, "no reason"), + ({"reason": " ", "names": {"boost::a": ["heap"]}}, + "no reason"), + ({"reason": "r", "names": {"boost::a": ["heep"]}}, + "unknown library 'heep'"), + ({"reason": "r", "names": {"boost::mpl::lambda": ["units"]}}, + "'units' is listed twice")): + errors = run(RULE, rule)[1] + self.assertEqual(len(errors), 1, errors) + self.assertIn(message, errors[0]) + + +class SkippedFileTests(unittest.TestCase): + ENTRIES = [ + ("core", "drop", "boost::size", "", "ambiguous"), + ("heap", "unreachable", "boost::mpl::lambda", "", "MPL"), + ("json", "guard", "boost::json::x", "defined(A)", "reason"), + ("numeric", "skip-directive", "boost::ublas::detail", + "boost::other, boost::ublas", "helpers"), + ] + + def test_entries_round_trip(self): + # A --libs run keeps the other libraries' entries from the file. + with tempfile.TemporaryDirectory() as tmp: + gen_exports.write_meta(Path(tmp), {}, self.ENTRIES) + path = Path(tmp) / "generated" / "meta" / "skipped.txt" + text = path.read_text(encoding="utf-8") + self.assertEqual(gen_exports._read_skipped(path), self.ENTRIES) + self.assertIn("json guard boost::json::x if defined(A) -- reason\n", + text) + self.assertIn("numeric skip-directive boost::ublas::detail using " + "boost::other, boost::ublas -- helpers\n", text) + + +if __name__ == "__main__": + unittest.main()