Open xmh0511 opened 4 months ago
I don't really see a defect here. If the expression is a prvalue, then the rule applies to the object that the prvalue tells you how to initialize.
However, I'm not opposed to consolidating all the relevant wording in [dcl.array] and making it more precise, if someone volunteers to do that.
Incidentally, if someone does volunteer to do that, they might be able to tackle CWG1304 at the same time.
We have specified how to calculate the bound in [dcl.array] p7. I don't think the rule should be repeated for 3 times.
It seems that the "declarator is followed by an initializer" part is problematic, as we don't want to limit the application of this rule to declarators.
How about just saying "is initialized with an initializer" in [dcl.array] p7?
Full name of submitter (unless configured in github; will be published with the issue): Jim X
Consider this case:
[dcl.array] p7 says:
The wording does not apply to this example because there is no declaration of an object, the expression is a prvalue. [dcl.init], [expr.new] specify how the array bound is calculated
[dcl.init.aggr] p10
[expr.new] p7
However, the nominated clause [expr.type.conv] in [dcl.array] does not describe how the array bound is calculated.
Suggested Resolution
Appending a similar wording in [expr.type.conv] p2