Handle explicit/deleted copy constructor and assignment#30
Open
slburson wants to merge 1 commit into
Open
Conversation
This was referenced Jul 1, 2026
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.
Claw generates setters for public fields of classes under certain conditions. Those conditions were too weakly specified, so that some of the generated setters were uncompilable. This happened when the type of the field was an unassignable class, which could happen for a few reasons (other than the obvious one of the field being declared
const):I had to include the last possibility because Claw doesn't see the bodies of excluded templates; so the rule makes the reasonable assumption that a template with a class parameter will use the class as a field type or superclass. As such, it's a little bit heuristic, but I figure it's better not to generate a needed setter — it can always be added manually — than to generate an uncompilable one.
Similarly, there are cases where the generated adapter function needs to use
std::moveto pass a parameter, because the parameter's pointer target type is not copy-constructible.For both of these, I've captured a little more information in libresect.