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
If T is a (possibly cv-qualified) class type ([class]), constructors are considered. The applicable constructors are enumerated ([over.match.ctor]), and the best one for the initializer () is chosen through overload resolution ([over.match]). The constructor thus selected is called, with an empty argument list, to initialize the object.
This usage requires that () be a valid value for the grammar term initializer. This is not the case according to the initializer definition:
initializer:
brace-or-equal-initializer
( expression-list )
expression-list cannot be empty, so () is not a valid initializer.
The text was updated successfully, but these errors were encountered:
This has been wrong since C++98. I think the best resolution would be to add [opt] after expression-list here, and rely on normal disambiguation rules to treat int x() as a function declaration. But I think this should be handled by CWG.
[dcl.init]/7.1 says:
This usage requires that
()
be a valid value for the grammar terminitializer
. This is not the case according to theinitializer
definition:expression-list
cannot be empty, so()
is not a validinitializer
.The text was updated successfully, but these errors were encountered: