Skip to content

Commit e28609f

Browse files
committed
fix: the stated tools of a toolchain are a named struct, not a std::pair specialization
Exporting `std::vector<std::pair<std::string, std::filesystem::path>>` from mcpp.toolchain.model made clang 20.1.7 on Windows crash while generating code for `mcpp::pack::interface_set_digest`, a function of another module that instantiates the same specialization and sorts by a pointer to its `first`. The report named a file this branch never touched, which is how this hazard always reads; `modules/manifest/src/types.cppm` records a GCC 16 case of the same shape. The field is now a `ToolOverride` of two named members, and every reader uses the same structured binding it used before.
1 parent d7da9cc commit e28609f

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎modules/toolchain-model/src/model.cppm‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,21 @@ struct Toolchain {
321321
// Tools stated by role where the layout does not have them
322322
// (`tools = { ld = ... }`): `ld`, `ar`, `ranlib`, `nm`, `objcopy`,
323323
// `strip`, `as`. Read before any derivation from the driver's directory.
324-
std::vector<std::pair<std::string, std::filesystem::path>> toolOverrides;
324+
//
325+
// A NAMED STRUCT, NOT `std::pair<std::string, std::filesystem::path>`, AND
326+
// THAT IS NOT A STYLE CHOICE. Exporting that specialization from this
327+
// module made clang 20.1.7 crash while generating code for
328+
// `mcpp::pack::interface_set_digest` -- a function in another module that
329+
// instantiates the same specialization and sorts by a pointer to its
330+
// `first`. The failure named a file this change never touched, which is
331+
// the signature of this hazard (`modules/manifest/src/types.cppm` records
332+
// a GCC 16 case of the same shape). Measured on windows-2022, clang
333+
// 20.1.7, 2026-10-01.
334+
struct ToolOverride {
335+
std::string role;
336+
std::filesystem::path program;
337+
};
338+
std::vector<ToolOverride> toolOverrides;
325339
// The driver-and-tool prefix of a cross toolchain (`aarch64-none-linux-gnu-`).
326340
std::string toolPrefix;
327341

0 commit comments

Comments
 (0)