Answer convertible_to_unexpected for void instead of hard-erroring#306
Open
Bronek wants to merge 3 commits into
Open
Answer convertible_to_unexpected for void instead of hard-erroring#306Bronek wants to merge 3 commits into
convertible_to_unexpected for void instead of hard-erroring#306Bronek wants to merge 3 commits into
Conversation
This was referenced Jul 13, 2026
🤖 Augment PR SummarySummary: This PR makes the convertibility concepts handle Changes:
Technical Notes: The new guards prevent class-body mandates (e.g. 🤖 Was this summary useful? React with 👍 or 👎 |
Member
Author
|
augment review |
Member
Author
|
augment review |
The mandate of `unexpected<void>` fires during instantiation, outside any immediate context - so the concept must not name it for void, which has no unexpected to convert to anyway. Closes #290 Assisted-by: Claude:claude-fable-5
…to_choice` The same class-body mandates that the `convertible_to_unexpected` conjunct keeps out of reach - `optional<void>` and `choice<void>` are ill-formed to instantiate, so each concept says no to void instead of asking. Closes #293 Assisted-by: Claude:claude-fable-5
`remove_cvref_t` folds cv-qualified void back to plain `void` inside each concept's naming, but the guard asked `same_as<T, void>`, which `void const` passes - reaching the same ill-formed instantiations the conjunct exists to avoid. The guard now asks `is_void_v`. `convertible_to_expected`'s arms answer through the same trait: a cv-qualified void is a void, on both sides of the question. Not reachable through deduction - a call expression never has cv-qualified void type ([expr.type]/2) - but the concepts are public surface, and an explicit spelling must get an answer. Assisted-by: Claude:claude-fable-5
75d05c5 to
863917f
Compare
2f50521 to
68e5e78
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.
The same void conjunct for all three convertibility concepts whose named type is ill-formed to instantiate for void.
Answer
convertible_to_unexpectedfor void instead of hard-erroringThe mandate of
unexpected<void>fires during instantiation, outside any immediate context - so the concept must not name it for void, which has no unexpected to convert to anyway.Extend the void answer to
convertible_to_optionalandconvertible_to_choiceThe same class-body mandates that the
convertible_to_unexpectedconjunct keeps out of reach -optional<void>andchoice<void>are ill-formed to instantiate, so each concept says no to void instead of asking.Closes #290
Closes #293
Stack: P12 of 13 — the release-0.1 bugfix queue, merging bottom-up into
main. Based on #305 and to be retargeted tomainonce it merges; the diff shows only this PR's commits. Every stack boundary was validated with a gcc build and the full test suite on top ofmain, and the aggregate branch ran the full CI matrix green (#289).