Why do seemingly all compilers reject the following program? (https://godbolt.org/z/EK8zW34nY)
struct A
{
explicit A() {}
};
int main()
{
A a = {};
}
a should be value-initialized per [dcl.init.list]/3.5 from what I can tell and that should in turn select a constructor as if to default-initialize a Default-initialization does not exclude explicit constructors.
This is a follow-up from a discussion with another user in another question:
Would one apply [over.match.list], which I do not think should apply here, then it would fail because of "In copy-list-initialization, if an explicit constructor is chosen, the initialization is ill-formed.".
When modifying the program to
struct A
{
explicit A() {}
template<typename = void>
A() {}
};
int main()
{
A a = {};
}
then GCC and Clang still reject it with error messages hinting that they consider it that way, while EDG and MSVC accept, choosing the templated constructor as if there was "copy-default-initialization" which excludes explicit constructors completely. (https://godbolt.org/z/xbzjhYYhM)