Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
starts. The doctest adapter's own test checks it under `mcpp test`.
- The conformance suite holds an implementation below level 3 that expresses `expected to fail` to
its `xfail`; the doctest fixture expresses it.
- `e2e::session` can be default-constructed. Its default constructor was defaulted in the interface
unit, which made every importer that default-constructs a session instantiate, under MSVC's
STL, the destructor of its `unique_ptr<state>` with `state` incomplete: a compile error. It is
declared in the interface and defined in `e2e.cpp`, beside the destructor and the move
constructor; a case constructs one and checks it holds nothing.
- CI builds and tests with mcpp 2026.11.22.1 and xlings 2026.11.21.1, the xlings that release
bundles (`.github/versions.env`).

Expand Down
6 changes: 5 additions & 1 deletion lib/src/e2e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,11 @@ session session::start(command c) {
return s;
}

session::session(session&&) noexcept = default;
// Defined here, not defaulted in the interface: the default constructor of a
// class holding unique_ptr<state> with state incomplete instantiates the
// pointer's destructor in the importer under MSVC's STL (sizeof an incomplete
// type), so a program could not default-construct a session at all.
session::session() = default;
session& session::operator=(session&&) noexcept = default;
session::~session() {
if (s_ && s_->started && s_->proc.valid()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/e2e.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public:
// whose `started()` is false and whose transcript says why.
static session start(command c);

session() = default;
session();
session(session&&) noexcept;
session& operator=(session&&) noexcept;
session(const session&) = delete;
Expand Down
6 changes: 6 additions & 0 deletions lib/tests/companions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ int main(int argc, char** argv) {
expect(eq(r.status, 7));
expect(contains(s.transcript(), "[sent] one"));
};
"a session default-constructed holds nothing"_test[kind::e2e] = [] {
e2e::session s; // an importer could not even write this line under MSVC's STL
expect(!s.started());
expect(!s.timed_out());
expect(s.pending().empty());
};
"a session whose program ended says so"_test[kind::e2e] = [] {
auto self = self_command();
expect(fatal(!self.empty()));
Expand Down
Loading