Repository navigation
fix: pointer slot never reads a reference dep and vice versa (#727) - #738
Merged
kris-jusiak merged 2 commits intoOct 18, 2026
Merged
kris-jusiak merged 2 commits into
kris-jusiak merged 2 commits into
Conversation
…xt#727) A pointer slot next to a same-type reference dep was built from the reference, and a reference slot next to a pointer dep from the pointer. A dep of the other kind now counts as missing. A reference slot still finds a derived reference dep beside a pointer dep.
| base727 base; | ||
| derived727 derived; | ||
| other727 other; | ||
| sml::sm<c727> sm{&base, derived, other}; |
Contributor
There was a problem hiding this comment.
That's probably another ambiguity case for which we could discuss and define the intended outcome first.
| struct c727 { | ||
| auto operator()() noexcept { | ||
| using namespace sml; | ||
| auto check = [](base727 &r, base727 *p, other727 &) { expect(5 == r.val && nullptr == p); }; |
Contributor
There was a problem hiding this comment.
That's probably another ambiguity case for which we could discuss and define the intended outcome first.
See #736
It is correct that base727* can be default constructed and that BOOST_SML_CREATE_DEFAULT_CONSTRUCTIBLE_DEPS is present.
On the other hand, the pointer could be initialized from the adress of the valid object the sm constructor already got, naively via &base, or std::adressof(base).
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 pointer slot next to a same-type reference dep was built from the reference (
pool_type<base*>::pool_type(base&)), and a reference slot next to a pointer dep from the pointer. A dep of the other kind now counts as missing, so the pointer slot stays null like before. Abase&slot beside abase*dep and aderived&binds the derived object.Two tests in dependencies.cpp, both failed to compile before. Full ft suite on gcc 14 (C++14/17/20), clang 21 (C++17), MSVC 19.51 (C++20).
#737 (missing pointer dep compiles to null) is untouched, the existing missing_void_ptr_dep test asserts null.
Closes #727