[Bug c++/25137] Warning "missing braces around initializer" causing problems with tr1::array
gdr at integrable-solutions dot net
gcc-bugzilla@gcc.gnu.org
Mon Nov 28 16:18:00 GMT 2005
------- Comment #4 from gdr at integrable-solutions dot net 2005-11-28 16:18 -------
Subject: Re: New: Warning "missing braces around initializer" causing
problems with tr1::array
"chris at bubblescope dot net" <gcc-bugzilla@gcc.gnu.org> writes:
| The following code:
|
| struct S
| { int x[3]; };
|
| void f()
| { S s = {1,2,3};}
|
| With -Wmissing-braces (which is implied by -Wall, among others) gives:
|
| warning: missing braces around initializer for 'int [3]'
|
| In the specific case where a struct contains only a single array, adding the
| extra braces doesn't really seem that useful.
|
| The reason it would be nice to fix this that in the definition of tr1::array
in
| the TR1 specification (page 88, 6.2.2) says
|
| 2.An array is an aggregate ([dcl.init.aggr]) that can be initialized with the
| syntax
| array a = { initializer-list };
I believe there is a slight confusion between a "C-array" and a TR1
class-type called "array". You have found a bug in the TR1; would you
mind making a report?
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25137
More information about the Gcc-bugs
mailing list