From StackOverflow (http://stackoverflow.com/q/44015848/2069064), this code: #include <cstdio> #include <initializer_list> struct S { S() { std::printf("DEF "); } // (1) S(std::initializer_list<int> il) // (2) { std::printf("L=%zu ", il.size()); } }; int main() { S x({}); } in gcc 7.1 with -std=c++1z invokes the default constructor. In C++14 mode, it invokes the initializer_list constructor, as does clang in both modes. But the default constructor shouldn't be invoked, since {} isn't an expression so the "guaranteed elision" bullet in dcl.init shouldn't apply.
Fixed in GCC 8+.
Dup of bug 81311. *** This bug has been marked as a duplicate of bug 81311 ***
*** Bug 97277 has been marked as a duplicate of this bug. ***