Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
585b59f
Regenerate the wording with specgen 0.58.0
steve-downey Nov 30, 2026
fee49da
Author error_or's Constraints so they name error-value-type
steve-downey Nov 30, 2026
2122747
Let specgen state and_then's U, as the draft does, for the lvalue ove…
steve-downey Nov 30, 2026
9179a45
Show constexpr where the header writes BEMAN_EXPECTED_CONSTEXPR_EXCEP…
steve-downey Nov 30, 2026
80a552e
Show the draft's declarations where the library strengthens them
steve-downey Nov 30, 2026
1346236
Record the specgen 0.58.0 round in the plan
steve-downey Nov 30, 2026
79f4642
Let specgen state U and G in the rest of the monadic operations
steve-downey Nov 30, 2026
dc94ab0
Drop the draft's copy of the [expected.bad.void] synopsis from the he…
steve-downey Nov 30, 2026
44063a0
Record the rulings, the filed specgen issues and rvalue-error-binding
steve-downey Nov 30, 2026
3f2815e
Log the review of rvalue-error-binding, and correct the alias count
steve-downey Nov 30, 2026
412d066
Take the decision numbers out of D4280's section titles
steve-downey Nov 30, 2026
a7572c2
Move the holder, not the error, in the rvalue observers and monadic o…
steve-downey Nov 30, 2026
00bcb83
Test that the rvalue observers and monadic operations do not steal a …
steve-downey Nov 30, 2026
de57385
Mark the rvalue error accesses in the paper's wording as std::move(un…
steve-downey Nov 30, 2026
bfbc12c
Record rvalue-error-binding as decided: std::move(unex).error()
steve-downey Nov 30, 2026
61e1271
Follow optional in the base templates where a reference U, G or E was…
steve-downey Nov 30, 2026
9b8234d
Mark the same corrections in the paper's wording
steve-downey Nov 30, 2026
a1261ab
Say in D4280 why the rvalue error accesses change, and what a referen…
steve-downey Nov 30, 2026
f616d7c
Record reference-result-of-transform and the rest of the optional com…
steve-downey Nov 30, 2026
169b152
Spell four out-of-line constraints exactly as their declarations do
steve-downey Nov 30, 2026
467a852
Build and test with MSVC in CI
steve-downey Nov 30, 2026
3d05901
Keep a test case name ASCII so ctest can select it on Windows
steve-downey Nov 30, 2026
0711692
Accept MSVC's deleted-function diagnostic in the initializer-list fai…
steve-downey Dec 1, 2026
d39ec76
Put MSVC's wording on its own EXPECT line so clang-format leaves it a…
steve-downey Dec 1, 2026
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
20 changes: 19 additions & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
{"preset": "llvm-debug", "image": "ghcr.io/bemanproject/infra-containers-clang:latest"},
{"preset": "llvm-release", "image": "ghcr.io/bemanproject/infra-containers-clang:latest"},
{"preset": "appleclang-debug", "runner": "macos-latest"},
{"preset": "appleclang-release", "runner": "macos-latest"}
{"preset": "appleclang-release", "runner": "macos-latest"},
{"preset": "msvc-debug", "runner": "windows-latest"},
{"preset": "msvc-release", "runner": "windows-latest"}
]

build-and-test:
Expand Down Expand Up @@ -138,6 +140,22 @@ jobs:
}
]
}
],
"msvc": [
{ "versions": ["latest"],
"tests": [
{ "cxxversions": ["c++23"],
"tests": [
{ "stdlibs": ["stl"],
"tests": [
"Debug.Default", "Release.Default", "Release.MaxSan",
"Debug.-DBEMAN_EXPECTED_USE_MODULES=On"
]
}
]
}
]
}
]
}

Expand Down
6 changes: 4 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"_debug-base"
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/msvc-toolchain.cmake"
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/msvc-toolchain.cmake",
"CMAKE_CXX_STANDARD": "23"
},
"condition": {
"type": "equals",
Expand All @@ -161,7 +162,8 @@
"_release-base"
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/msvc-toolchain.cmake"
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/msvc-toolchain.cmake",
"CMAKE_CXX_STANDARD": "23"
},
"condition": {
"type": "equals",
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ WORDING_DIR := papers/wording
WORDING_FRAGMENTS := \
$(addprefix $(WORDING_DIR)/fragments/,$(addsuffix .tex,$(WORDING_CLAUSES)))

SPECGEN_CLANG_ARGS := -std=c++2c -Iinclude
# The wording shows the standard's expansion of a configuration macro, not
# whichever one the standard library specgen's Clang finds happens to give:
# BEMAN_EXPECTED_CONSTEXPR_EXCEPTION is `constexpr` in the draft, which is
# what this feature-test macro selects. The value is libstdc++ 16's.
SPECGEN_CLANG_ARGS := -std=c++2c -Iinclude \
-D__cpp_lib_constexpr_exceptions=202502L
ifneq ($(SPECGEN_GCC_TOOLCHAIN),)
SPECGEN_CLANG_ARGS += --gcc-toolchain=$(SPECGEN_GCC_TOOLCHAIN)
endif
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,20 @@ builtin lands in **GCC 13** and **Clang 19**, which sets the floor:

* **GCC ≤ 12 / Clang ≤ 17** lack the builtin, so the trait is undefined in C++20
mode.
* **Clang 18** has the builtin but rejects out-of-line definitions of constrained
members whose `requires`-clause names the enclosing `expected<…>` type (or a
member typedef) with a spelling that differs from the in-class declaration —
GCC and Clang 19+ canonicalize these, Clang 18 does not.
* **Clang 18** has the builtin. It rejects an out-of-line definition of a
constrained member whose `requires`-clause names the enclosing `expected<…>`
type (or a member typedef) with a spelling that differs from the in-class
declaration — GCC and Clang 19+ canonicalize these, Clang 18 does not. Each
such definition is therefore spelled exactly as its declaration, and Clang 18
accepts the header; it is not in the CI matrix.

**MSVC is not currently supported.** In C++23 the trait is available, but MSVC
applies the same out-of-line-definition constraint-matching strictness as Clang
18 (`C2244: unable to match function definition to an existing declaration`).
The fix is to make each such member's definition token-identical to its
declaration; that work is not done here simply because we do not have direct
MSVC access to develop and verify the workarounds. Contributions with MSVC
access are welcome.
The four definitions MSVC 19.52 rejected for this are now token-identical to
their declarations, checked with Clang 18, which rejected the same four. We do
not have direct MSVC access, so the MSVC jobs in CI, which build and test at
C++23, are the only verification. Contributions with MSVC access are welcome.

The Windows setup below is retained for contributors who want to investigate
MSVC support. It is currently unsupported and unverified; the documented build
Expand Down
225 changes: 222 additions & 3 deletions docs/plan/specgen-catchup.md

Large diffs are not rendered by default.

35 changes: 11 additions & 24 deletions include/beman/expected/bad_expected_access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,6 @@ namespace std {
}
*/

/***
22.8.5 Class template specialization bad_expected_access<void>[expected.bad.void]
namespace std {
template<>
class bad_expected_access<void> : public exception {
protected:
constexpr bad_expected_access() noexcept;
constexpr bad_expected_access(const bad_expected_access&) noexcept;
constexpr bad_expected_access(bad_expected_access&&) noexcept;
constexpr bad_expected_access& operator=(const bad_expected_access&) noexcept;
constexpr bad_expected_access& operator=(bad_expected_access&&) noexcept;
constexpr ~bad_expected_access();

public:
constexpr const char* what() const noexcept override;
};
}
*/

namespace beman {
namespace expected {

Expand All @@ -64,12 +45,18 @@ class bad_expected_access;
template <>
class bad_expected_access<void> : public std::exception {
protected:
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION bad_expected_access() noexcept = default;
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION bad_expected_access(const bad_expected_access&) noexcept = default;
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION bad_expected_access(bad_expected_access&&) noexcept = default;
//! \omit default
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION bad_expected_access() noexcept = default;
//! \omit default
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION bad_expected_access(const bad_expected_access&) noexcept = default;
//! \omit default
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION bad_expected_access(bad_expected_access&&) noexcept = default;
//! \omit default
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION bad_expected_access& operator=(const bad_expected_access&) noexcept = default;
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION bad_expected_access& operator=(bad_expected_access&&) noexcept = default;
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION ~bad_expected_access() = default;
//! \omit default
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION bad_expected_access& operator=(bad_expected_access&&) noexcept = default;
//! \omit default
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION ~bad_expected_access() = default;

public:
BEMAN_EXPECTED_CONSTEXPR_EXCEPTION const char* what() const noexcept override;
Expand Down
Loading
Loading