Skip to content

Conversation

@eisenwave
Copy link
Member

@eisenwave eisenwave commented Nov 12, 2025

Notice that the return type is T&, but convert-ref-init-val is a void member function.

The intent is obviously to return *val; this seems like an editorial slip-up (unfortunately resulting in a normative defect).

@eisenwave eisenwave added the P1-Important Misapplication of paper, malformed code, internal inconsistencies label Nov 12, 2025
@eisenwave eisenwave requested a review from jwakely November 12, 2025 18:34
Copy link
Member

@jwakely jwakely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd usually just say Returns: *val in cases like this.

@jwakely
Copy link
Member

jwakely commented Nov 12, 2025

i.e. nothing in the current wording says it returns the result of convert-ref-init-val so the fact it's a void expression is irrelevant.

@eisenwave eisenwave force-pushed the optional-ref-missing-return branch from ec8a30d to 0d64621 Compare November 12, 2025 18:51
@eisenwave eisenwave changed the title [optional.ref.assign] Add missing "return" [optional.ref.assign] Add missing Returns element Nov 12, 2025
@jensmaurer jensmaurer requested a review from jwakely November 12, 2025 18:53
@tkoeppe tkoeppe merged commit 4b9d4f6 into cplusplus:main Nov 12, 2025
2 checks passed
@tkoeppe tkoeppe removed the P1-Important Misapplication of paper, malformed code, internal inconsistencies label Nov 12, 2025
@eisenwave
Copy link
Member Author

You will be shocked to find out what we've just merged is exactly the solution in LWG4300, which was just approved in Kona.

@jwakely
Copy link
Member

jwakely commented Nov 14, 2025

We'd usually just say Returns: *val in cases like this.

Well at least I was consistent 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants