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
When objects of class type are direct-initialized, copy-initialized from an expression of the same or a derived class type ([dcl.init]), or default-initialized, overload resolution selects the constructor. For direct-initialization or default-initialization that is not in the context of copy-initialization, the candidate functions are all the constructors of the class of the object being initialized. 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. The argument list is the expression-list or assignment-expression of the initializer.
Default-initialization invokes this clause with "the initializer ()" (see #2846) for class types. This clause has a similar issue.
The sentence "The argument list is the expression-list or assignment-expression of the initializer" uses the initializer grammar term:
initializer:
brace-or-equal-initializer
( expression-list )
This does not accept ().
Thus, this clause has no ability to handle invoking a default constructor, such as default-initialization intends to invoke for class types.
The text was updated successfully, but these errors were encountered:
... but we're also missing an "if any" after "the expression-list" here.
jensmaurer
changed the title
[over.match.ctor] Initialization by "()" does not match "initializer" grammer term
[over.match.ctor] Initialization by "()" does not match "initializer" grammar term
May 28, 2019
[over.match.ctor] says:
Default-initialization invokes this clause with "the initializer ()" (see #2846) for class types. This clause has a similar issue.
The sentence "The argument list is the expression-list or assignment-expression of the initializer" uses the
initializer
grammar term:This does not accept
()
.Thus, this clause has no ability to handle invoking a default constructor, such as default-initialization intends to invoke for class types.
The text was updated successfully, but these errors were encountered: