On Tue, Nov 17, 2009 at 04:07:28PM -0800, Ian Lance Taylor wrote: > Paolo Carlini <paolo.carl...@oracle.com> writes: > > > Ian Lance Taylor wrote: > >> OK, to me that seems like an excellent reason to implement a special > >> case for the warning here. For example, perhaps if a struct has only > >> one field, and that field is an aggregate, then we don't warn if there > >> is only one set of braces. > >> > > Sure, we considered that, you can find traces of that reasoning in the > > audit trail, then lately I noticed the ICC and SunStudio behaviors, and > > that idea appeared to me a tad too sophisticated... but if people agree, > > I can return to it. Do you think that version of the warning should be > > simply the default, right, simply the new behavior of -Wmissing-braces? > > I suppose so but I'd be happy to hear other opinions.
I think that the cleanest way is to suppress the warning for structs with one member, rather than treating tr1::array as a special case, as Jonathan Wakely suggested. The point of warnings should be to help people write correct, non-buggy, portable code, and omitting the outer braces in this case is allowed by the standard and isn't going to result in unexpected behavior.