Hi, I think I came across a compiler bug.
The following example throws on intel c++ compiler 2017.4.210
This is using c++14, Windows 7, Visual studio 2017.
#include <vector> #include <stdexcept> struct A { int a; int b; int c; int d; }; struct B { A a; std::vector<int> b; }; int main() { B b{}; if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?"); }
b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.