New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[expr.type.conv] Move description of 'auto' deduction to [dcl.type.auto.deduct] #5039
Conversation
@tkoeppe, this needs a rebase after the force-push to main. |
I like the radical suggestion:
And then move the "shall" up to dcl.type.auto.deduct:
@tkoeppe, this is now your branch/diff, so I can't do much here. |
@jensmaurer: you can bring your sense of Core aesthetics to bear on reviewing Mr Smith's idea :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
If the initializer is a parenthesized \grammarterm{expression-list}, | ||
the \grammarterm{expression-list} shall be | ||
a single \grammarterm{assignment-expression} | ||
and $E$ is the \grammarterm{assignment-expression}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird to say this explicitly for auto(4)
but not for auto x(4);
, since the latter's initializer is (4)
. It's preexisting, but should we adjust /2.2 (or even try to combine them)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But... we say that in p2.2.3:
If the initializer is a parenthesized expression-list, the expression-list shall be a single assignment-expression and E is the assignment-expression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say let's leave this for now? I'm not sure what exactly we could improve here.
…' deduction This change moves the fact that 'the type shall be auto' from [expr.type.conv] to [dcl.type.auto.deduct], and thus avoids repeating the mechanism of placeholder deduction.
Fixes #4745.
See #5015 for discussion and suggestions.