Title
Aggregate initialization and user-defined conversion sequence
Status
open
Section
12.2.4.2.6 [over.ics.list]
Submitter
Johannes Schaub

Created on 2023-08-18.00:00:00 last changed 15 months ago

Messages

Date: 2023-08-18.00:00:00

Subclause 12.2.4.2.6 [over.ics.list] paragraph 8 specifies:

Otherwise, if the parameter has an aggregate type which can be initialized from the initializer list according to the rules for aggregate initialization (9.4.2 [dcl.init.aggr]), the implicit conversion sequence is a user-defined conversion sequence whose second standard conversion sequence is an identity conversion.

However, a user-defined conversion sequence cannot contain an aggregate initialization per 12.2.4.2.3 [over.ics.user] paragraph 1:

A user-defined conversion sequence consists of an initial standard conversion sequence followed by a user-defined conversion (11.4.8 [class.conv]) followed by a second standard conversion sequence.

To complete the argument, subclause 11.4.8 [class.conv] paragraph 1 specifies:

Type conversions of class objects can be specified by constructors and by conversion functions. These conversions are called user-defined conversions...

Possible resolution:

Change in 12.2.4.2.3 [over.ics.user] paragraph 1 as follows:

A user-defined conversion sequence consists of an initial standard conversion sequence, followed by a user-defined conversion (11.4.8 [class.conv]) or an aggregate initialization (9.4.2 [dcl.init.aggr]), followed by a second standard conversion sequence.
History
Date User Action Args
2023-08-18 00:00:00admincreate