https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750

--- Comment #12 from nightstrike <nightstrike at gmail dot com> ---
(In reply to Daniel Sommermann from comment #11)
> Created attachment 33627 [details]
> Test case showing overly strict warning
> 
> This still produces false positives in C++11.
> 
> I attached a test case with several false positives. The compilation should
> be clean as there are no uninitialized members. Repros with g++ 4.9.1
> 
> Compile with "g++ test.cpp -std=c++11 -Wmissing-field-initializers`"
> 
> Produces:
> 
> dcsommer@dcsommer-ThinkPad-T440s:~/src/proxygen-oss-test/proxygen$ g++
> test.cpp -Wmissing-field-initializers -std=c++11
> test.cpp: In function ‘int main()’:
> test.cpp:7:10: warning: missing initializer for member ‘Foo::bar’
> [-Wmissing-field-initializers]
>    Foo f1{};
>           ^
> test.cpp:7:10: warning: missing initializer for member ‘Foo::baz’
> [-Wmissing-field-initializers]
> test.cpp:8:11: warning: missing initializer for member ‘Foo::baz’
> [-Wmissing-field-initializers]
>    Foo f2{0};
>            ^
> test.cpp:9:14: warning: missing initializer for member ‘Foo::baz’
> [-Wmissing-field-initializers]
>    Foo f3 = {0};
>               ^
> test.cpp:10:15: warning: missing initializer for member ‘Foo::baz’
> [-Wmissing-field-initializers]
>    Foo f4 = {0,};
>                ^


This reproduces with 4.9.2 as well.  Request reopen.

Reply via email to