Skip to content

add yandere-chan.binary_tree 0.1.4 - #848

Merged
Sunrisepeak merged 5 commits into
mcpplibs:mainfrom
YandereChan2:add-binary_tree-0.1.0
Nov 20, 2026
Merged

Sunrisepeak merged 5 commits into
mcpplibs:mainfrom
YandereChan2:add-binary_tree-0.1.0

Conversation

@YandereChan2

@YandereChan2 YandereChan2 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Shape

Form A mcpp-native package, namespace yandere-chan, name binary_tree. The 0.1.4 tarball carries the library's own mcpp.toml (mcpp = "*/mcpp.toml"): header library, the three module wrappers (Yc.intrusive_binary_tree, Yc.binary_tree, Yc.parent_aware_binary_tree), and src/binary_tree.cppm as the lib root (import binary_tree;).

The libc++ placement-new fix

The earlier Linux LLVM failure was clang's combined -fmodule-output module build not making the module's GMF <new> visible to importers (llvm/llvm-project#218246, #59601); libc++'s allocator_traits::construct looks placement new up when the consumer instantiates it. A consumer-side #include <new> worked but is surprising.

0.1.4 exports the global placement operator new/operator delete using-declarations from each module interface:

import Yc.intrusive_binary_tree;
export using ::operator new;
export using ::operator delete;

An importer can then instantiate the tree without including <new>, and a consumer that includes <new> still compiles. The declarations sit after the imports because GCC requires post-module imports to be contiguous. The umbrella module re-exports them through export import, which a dedicated umbrella-only test checks.

0.1.0-0.1.3 are not listed (old YandereChan2 namespace; 0.1.3 also predates the export).

Mirror

No mcpp-res mirror yet; plain-string GLOBAL URL fallback, no invented CN mirror.

Test member

tests/examples/binary_tree-module/ now has binary_tree_module.cpp (imports the umbrella and every wrapper, asserts owning/intrusive behavior) and binary_tree_umbrella.cpp (imports only binary_tree). Neither includes <new> or a library header. Both use the [indices] yandere-chan = { path = "../../.." } redirect.

Verification

  • local mcpp test -p binary_tree-module --cache off: 2 passed; 0 failed.
  • local clang 23.1.3 combined-mode minimal repro of the placement-new bug fails without the export and passes with it; MSVC 14.51 and GCC 16.1 accept the exported form.
  • upstream build: mcpp build (clang), mcpp build --toolchain msvc@system, GCC 16.1 on all four .cppm.
  • 0.1.4 asset sha256 e7bd88adaa156219d87db05cbe4bc0dd5447ee7c7736f138f0870ebdfa706853.

Form A package: the tag tarball carries the library's own mcpp.toml, which declares the header library and the C++23 module wrappers (binary_tree, Yc.intrusive_binary_tree, Yc.binary_tree, Yc.parent_aware_binary_tree). Adds tests/examples/binary_tree-module, which imports the lib root and every wrapper and asserts owning/intrusive tree behavior.
0.1.0 and 0.1.1 fail a libc++ module consumer because placement new is not declared when allocator_traits is parsed. 0.1.2 includes <new> before <memory> in the owning headers and in the module GMF. Update the descriptor, the test member dependency and the plan.
@YandereChan2 YandereChan2 changed the title add YandereChan2.binary_tree 0.1.0 add YandereChan2.binary_tree 0.1.2 Nov 19, 2026
Use the lowercase hyphenated namespace yandere-chan for the package identity and the index file. Move to 0.1.3, which carries the same libc++ <new> fix under the new namespace; 0.1.0-0.1.2 stay unlisted.
@YandereChan2 YandereChan2 changed the title add YandereChan2.binary_tree 0.1.2 add yandere-chan.binary_tree 0.1.3 Nov 19, 2026
libc++'s allocator_traits::construct instantiates __construct_at with a placement-new default argument in the importer's context; the module GMF <new> is not reachable from an importer. Include <new> before the imports in the consumer (no-op on MSVC STL/libstdc++) and correct the design note.
clang's combined -fmodule-output build does not make the module GMF <new> visible to importers, so libc++ consumers instantiating allocator_traits::construct needed #include <new>. The three module interfaces now export using ::operator new/::operator delete; both tests build without <new>, including an umbrella-only test. Update the descriptor to 0.1.4 and the plan.
@YandereChan2 YandereChan2 changed the title add yandere-chan.binary_tree 0.1.3 add yandere-chan.binary_tree 0.1.4 Nov 19, 2026
@Sunrisepeak
Sunrisepeak merged commit 67b1022 into mcpplibs:main Nov 20, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants