1 2 3 4 5 6 7 8 9 10
struct T { std::vector<int> v; int w; T(int w) : w(w), v(0, w) {} }; int main() { T t(3); }
1 2 3 4 5
cc1plus: warnings being treated as errors t.cpp: In constructor 'T::T(int)': Line 3: warning: 'T::w' will be initialized after Line 2: warning: '__gnu_debug_def::vector<int, std::allocator<int> > T::v' Line 5: warning: when initialized here