Код: Выделить всё
#include
struct C
{
C(){}
C(std::initializer_list i = {3})
{
}
};
int main()
{
C d{}; //clang:Ok, gcc:No, MSVC: No, EDG: No
}
Код: Выделить всё
: In function 'int main()':
:20:9: error: call of overloaded 'C(
)' is ambiguous
20 | C d{}; //clang:Ok, gcc:No, MSVC: No, EDG: No
| ^
:10:5: note: candidate: 'C::C(std::initializer_list)'
10 | C(std::initializer_list i = {3})
| ^
:6:5: note: candidate: 'C::C()'
6 | C()
| ^
Подробнее здесь: https://stackoverflow.com/questions/788 ... -is-also-a