You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[dcl.init.list] says that a designated-initializer-list can only be used to initialize an aggregate class. [over.ics.list] says that a designated-initializer-list can only be used to form an implicit conversion sequence for an aggregate. Longstanding implementation practice and expectations of consistency suggest that we should additionally permit initialization of a (const or rvalue) reference to aggregate class, creating a temporary as normal.
Suggested resolution:
Change in [dcl.init.list]/3.1:
If the braced-init-list contains a designated-initializer-list and T is not a reference type, T shall be an aggregate class. [...]
Change in [over.ics.list]/2:
If the initializer list is a designated-initializer-list and the the parameter is not a reference, a conversion is only possible if the parameter has an aggregate type that can be initialized from the initializer list according to the rules for aggregate initialization ([dcl.init.aggr])