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
The initialization that occurs in the = form of a brace-or-equal-initializer or condition ([stmt.select]), as well as in argument passing, function return, throwing an exception ([except.throw]), handling an exception ([except.handle]), and aggregate member initialization ([dcl.init.aggr]), is called copy-initialization.
Consider this example:
structT{
explicitT(){}
};
T v = T();
The initialization occurs in the = form of a brace-or-equal-initializer, even though we have specified that the result object is direct-initialized by (). So the initialization is in the context of the copy-initialization? The explicit default constructor won't be considered for the default-initialization, according to [over.match.ctor] p1
For copy-initialization (including default initialization in the context of copy-initialization), the candidate functions are all the converting constructors ([class.conv.ctor]) of that class.
Presumably, It is not the intent of these rules. [dcl.init.general] p14 just contradicts the initialization specified for prvalue(e.g. which wants that the context is a direct-initialization).
This issue might relate to #4582. We should remove [dcl.init.general] p14. What kind of initialization(i.e. copy or direct-initialization) should be decided/specified by the concrete rules.
The text was updated successfully, but these errors were encountered:
[dcl.init.general] p14 says
Consider this example:
The initialization occurs in the
=
form of a brace-or-equal-initializer, even though we have specified that the result object is direct-initialized by()
. So the initialization is in the context of the copy-initialization? The explicitdefault constructor
won't be considered for the default-initialization, according to [over.match.ctor] p1Presumably, It is not the intent of these rules. [dcl.init.general] p14 just contradicts the initialization specified for prvalue(e.g. which wants that the context is a direct-initialization).
This issue might relate to #4582. We should remove [dcl.init.general] p14. What kind of initialization(i.e. copy or direct-initialization) should be decided/specified by the concrete rules.
The text was updated successfully, but these errors were encountered: