Repository navigation
0.19.1: json::value compiles under clang with libstdc++, and CI reads every build program as an editor does - #47
Merged
Conversation
… every build program as an editor does
`mcpp::plugins::json::value` held `std::vector<std::pair<std::string, value>>`.
Under clang with libstdc++'s `std` module the pair is instantiated while `value`
is incomplete, so `mcpp.plugins` failed to compile and an editor's clangd --
which reads a GCC project with exactly that combination -- showed every
`import mcpp.…;` of a build program as a missing module. GCC and clang with
libc++ accept the code, so no build ever failed.
A member is now a plain struct `member { first; second; }` and `get()` is
defined once both types are complete. `members` is used only inside the lib
root and the fields keep their names, so the change is source-compatible.
CI gains the two combinations it did not compile: `toolchain-llvm` builds and
runs the toolchain-neutral fixtures under llvm@22.1.8 with libc++ (the Qt
fixtures configure only, since Qt's Linux binaries are built against
libstdc++), and `toolchain-editor` reads every fixture's `build.mcpp` with
mcppls 0.0.15 over the GCC toolchain and fails on any error or on a file it did
not read. On the previous code 34 of 37 fixtures fail there.
docs/plugin-development.md §4 states the rule: a plugin is the C++23 that all
three accept, with the differences met so far.
Closes #46
…t is before it is opened
Sunrisepeak
added a commit
to Sunrisepeak/mcpp-language-server
that referenced
this pull request
Oct 13, 2026
…nput is no change, a module that failed in an import is named, build.mcpp beside the mcpp extension (#58) Typing (A4), idle (A1, A2), failed modules (A3) and build.mcpp beside mcpp-vscode (A6); plan .agents/docs/2026-10-14-cross-repo-build-mcpp-and-typing-cpu-plan.md. With mcpp-community/mcpp-vscode#18 and mcpp-community/mcpp-plugins#47.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46.
The defect
mcpp::plugins::json::valueheldstd::vector<std::pair<std::string, value>> members. Under clang with libstdc++'sstdmodule the pair is instantiated whilevalueis incomplete (incomplete type 'std::pair<…, value>' used in type trait expression), somcpp.pluginsdoes not compile. That is the combination an editor's clangd uses to read a project built with GCC, so everyimport mcpp.…;in such a project'sbuild.mcppshowedModule file '…/mcpp.rules.qt.pcm' not found. GCC and clang with libc++ accept the code; no build failed.The fix
struct member { std::string first; value second; }, withget()defined after both types are complete.membersis used only insrc/plugins.cppm, andemplace_back(key, v)builds the aggregate through C++20's parenthesized aggregate initialisation, so nothing else changes.CI: the two combinations nothing compiled
consumers(unchanged)toolchain-llvm(new)--configure-onlyfor the four Qt fixtures, whose Qt binaries are libstdc++ — the build program and library still compile and runtoolchain-editor(new)mcppls diagnostics build.mcppon all 37 fixtures with a build program; fails on an error, on a file it did not read, or on a run with no report; every diagnostic goes to the job summaryThe device-toolchain fixtures (cuda, hip, sycl, multi-rule) already build with llvm@22.1.8 in
consumers, and the deps members' libc++ rows arevcpkg-libcxxandcmake-cachethere, so the llvm lane does not repeat them.Measured locally before pushing:
src/plugins.cppm: 34 of 37 fixtures fail with the error above; with this change, 0 errors in all 37;-stdlib=libc++.The rule
docs/plugin-development.md §4: a plugin is the C++23 that all three accept (MSVC as well for the members that claim Windows), with the differences met so far — no
std::pair/std::tupleelement for a type holding a container of itself, no compiler's leniency, nostd::printlnin a build program (macOS 14), nostd::filesystem::pathiterator in a module (MSVC 14.52).Version 0.19.1: source-compatible, package floor unchanged (mcpp 2026.10.1.3).