Repository navigation
Account for callback-result construction in pfn monadic noexcept - #460
Merged
Merged
Conversation
Include copying or moving a reference-returned optional in and_then and or_else exception specifications. Preserve guaranteed elision for prvalue results and the draft's constraints and hard-error behavior. Cover result and source cv/ref categories, exception propagation, and immovable prvalues. Keep the new regressions out of the fn wrapper suite, whose exception specifications are separate work. Assisted-by: Codex:gpt-6
Include result copying or moving in and_then and or_else while retaining the unchanged-side construction checks. Preserve guaranteed elision for prvalue results and the draft's constraints and hard-error behavior. Test all source cv/ref categories, reference-result copies and moves, exception propagation, and immovable prvalues against pfn and std. Assisted-by: Codex:gpt-6
Include result copying or moving in and_then and or_else. Keep the error construction check on and_then and preserve guaranteed elision for prvalues without adding constraints. Exercise the same source and result cv/ref matrix as the object specialization, including exception propagation and immovable results. Guard constructor-noexcept extension assertions in std validation. Assisted-by: Codex:gpt-6
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🤖 Augment PR SummarySummary: Corrects callback-result handling in
🤖 Was this summary useful? React with 👍 or 👎 |
MSVC 19.44 miscompiles negation of an enclosing boolean template parameter across generic-lambda instantiations. Compare has_value() directly with Recover using !=, preserving the assertions. A standalone reproducer fails without libfn or Catch2. The affected helper reproduces all 32 assertion failures on Godbolt MSVC in /Od and /O2; both configurations pass with this change. Rebuilt GCC and Clang expected suites also pass. Assisted-by: Codex:gpt-6
|
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.



A non-throwing callback can return an optional or expected by reference while copying or moving that result throws. The monadic operation previously overlooked that construction in its exception specification and could terminate instead of propagating the exception.
Account for result construction in
and_thenandor_elsefor owning and referencepfn::optionaland bothpfn::expectedspecializations. Useis_nothrow_invocable_rwhile retaining the existing checks for constructing the unchanged alternative. Preserve guaranteed copy elision for immovable prvalues, the draft's constraints, and invalid-callback diagnostics.Addresses the
pfnportion of #436. Noinclude/fnfiles are changed; thefnwrapper fixes remain separate work. Document that remaining difference and exclude these new regressions from the shared suite'sfninstantiations.Validation:
Assisted-by: Codex:gpt-6