This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [testsuite patch] Fix C++11 compilation failure for gdb.cp/m-static.exp
- From: Pedro Alves <palves at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches at sourceware dot org
- Date: Thu, 15 Sep 2016 13:22:54 +0100
- Subject: Re: [testsuite patch] Fix C++11 compilation failure for gdb.cp/m-static.exp
- Authentication-results: sourceware.org; auth=none
- References: <20160911142248.GA12817@host1.jankratochvil.net>
On 09/11/2016 03:22 PM, Jan Kratochvil wrote:
>
> After the fix out of the 4 combinations above only this one remains non-empty:
>
> clang++:
> In file included from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.cc:79:
> /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:22: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init]
> static const float somewhere = 3.14159;
> ^ ~~~~~~~
> 1 warning generated.
>
Did you try moving the initialization to the .cc file? Like:
const float gnu_obj_4::somewhere = 3.14159;
Did you find a reason to not do that?
Thanks,
Pedro Alves