[Bug c/36750] -Wmissing-field-initializers relaxation request
nightstrike at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Apr 15 05:54:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
--- Comment #8 from nightstrike <nightstrike at gmail dot com> ---
Are you sure C++ works like that? I thought that member variables in a struct
would get default initialized to indeterminate values, as seen here:
http://en.cppreference.com/w/cpp/language/default_initialization
Surely, the C++ syntax of saying MyType x = {}; should be supported, as seen
here:
http://en.cppreference.com/w/cpp/language/aggregate_initialization
where for instance:
struct S {
int a;
float b;
std::string str;
};
S s = {}; // identical to S s = {0, 0.0, std::string};
That shouldn't warn for the reasons stated in earlier comments.
More information about the Gcc-bugs
mailing list