Repository navigation
fix(e2e): define session's default constructor out of line - #33
Merged
Merged
Conversation
session() = default in the interface instantiates, in every importer under MSVC's STL, the destructor of unique_ptr<state> with state incomplete (sizeof an incomplete type): a program could not default-construct a session at all. Declared in the interface, defined in e2e.cpp; a case constructs one.
Sunrisepeak
force-pushed
the
fix/session-default-ctor
branch
from
November 30, 2026 20:50
207fee0 to
43713a0
Compare
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.
What
e2e::session() = default;in the interface unit makes every importer that default-constructs a session instantiate, under MSVC's STL, the destructor ofunique_ptr<session::state>withstatestill incomplete:So a test program cannot hold a session as a member that is started later (a fake server for the cases of a file, started in the body's scope).
Change
lib/src/e2e.cppm:session();declared.lib/src/e2e.cpp:session::session() = default;defined, beside the move constructor and destructor that are already out of line.lib/tests/companions.cpp: a case that default-constructs a session and checks it holds nothing (started,timed_out,pending).Verification
mcpp test -p lib companionson Windows (clang 23.1.3, MSVC STL): the new case passes; 27 of 28 cases pass. The one failure,a session expects and sends(expect(fatal(got.has_value()))ongot: (\w+)\n>), fails identically on the unmodified base of this branch on this Windows host — the child's text-mode stdout writes\r\n>, which the pattern does not match. It is not touched here; noting it as a separate Windows issue.Authorship: ai-and-human