Skip to content

[expr.type.conv] Awkward invented declaration in P0849 #4745

@opensdh

Description

@opensdh

For @jensmaurer: the version approved by CWG (pending review by LWG) contains in [expr.type.conv]/1

Otherwise, if the type is auto, it is replaced by the type deduced for the variable x in the invented declaration ([dcl.spec.auto]), which is never interpreted as a function declaration:

auto x init;

, where init is the initializer.

The appositive with the intervening relative clause and colon is a bit broken, as is the trailing comma. My preferred means of addressing this is to replace the whole sentence with

Otherwise, if the type is auto, it is replaced by the type determined by placeholder type deduction ([dcl.spec.auto.deduct]).

and add a bullet to [dcl.spec.auto.deduct]/2:

  • for an explicit type conversion ([expr.type.conv]), T is auto and E is the initializer.

Using auto explicitly rather than referring to "the specified type" avoids an ordering question with the replacement of that auto with the deduced type.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions