https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78550
Bug ID: 78550 Summary: [6/7 Regression] bit field and std::initializer_list Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: trippels at gcc dot gnu.org Target Milestone: --- Gavrilov Vladimir reported the following issue in a direct email to gcc-bugs: markus@x4 tmp % cat map_bitfield.cpp #include <map> struct A { int i : 1; }; std::map<int, A> ma{{1, {0}}}; markus@x4 tmp % g++ -c map_bitfield.cpp map_bitfield.cpp:5:30: error: invalid initial value for member âiâ std::map<int, A> ma{{1, {0}}}; ^ GCC-5 and other compilers accept this code. A bit further reduced: markus@x4 tmp % cat map_bitfield2.cpp #include <initializer_list> template <typename T> struct A { A(std::initializer_list<T>); }; struct B { int k : 1; }; A<B> a{{0}}; markus@x4 tmp % g++ -c map_bitfield2.cpp map_bitfield2.cpp:6:12: error: invalid initial value for member âkâ A<B> a{{0}}; ^