As far as I understand, the following program should not be compiled according to the standard , however the latest versions of gcc , clang and MSVC compile it without errors. Do I misunderstand something or are compiler defects?
12.7 Name resolution [temp.res]
8 ... The program is ill-formed, no diagnostic required, if:
(8.3) every valid specialization of a variadic template requires an empty template parameter pack
template<typename... Args> struct A { A(const Args&... args) : x(0, args...) {} int x; }; int main() { A<> x; }
x0. If writeA<int> x{0};- then it doesn't compile, everything is fine - VTT