struct Bar { Bar() {} }; struct Foo { Foo() = default; Bar m_bar; }; int main() { Foo foo; }
When using C++11 default
keyword and gcc warning -Weffc++
, gcc outputs:
warning: ‘Foo::m_bar’ should be initialized in the member initialization list [-Weffc++]
Is it safe to ignore this warning? Should I file a bug to gcc?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With