On Mon, Nov 29, 2010 at 11:51 PM, Miles Bader <mi...@gnu.org> wrote: > Ian Lance Taylor <i...@google.com> writes: >> We could decide not to do anything about this, but I don't think it's a >> non-issue. With -std=gnu++98 g++ accepts this invalid code. That is, >> it is a g++ extension, and the code is properly rejected with >> -pedantic-errors. We could decide to carry the extension forward to >> -std=gnu++0x. Or we could decide to carry the extension forward to >> -std=gnu++0x when -fpermissive is used. Or we could decide to just drop >> the extension. >> >> The main problem with the last option is that it complicates the >> migration of existing gnu++98 programs to gnu++0x. It becomes necessary >> to add constexpr to use gnu++0x. Unfortunately, gnu++98 rejects >> constexpr. So there is no simple way to modify this program to be both >> valid gnu++98 and valid gnu++0x. That makes the transition more >> difficult. >> >> It seems to me that it would be better for our users to accept this code >> in gnu++0x mode with -fpermissive. > > I agree. > > I used to use this feature a lot, and indeed that was the primary reason > I _didn't_ use -pedantic-errors. > > It's nice that C++0x has an official way to support this feature (it > seems very silly that C++98 didn't), but there are surely many projects > that don't want to commit to C++0x just yet. > > [Recently I went through and changed all my uses of "static const float" > fields to use inline static methods instead, which is at least portable, > but yuck, how ugly is that...]
If you are doing that, why don't you write a simpler code by just defining (e.g. initializing) the data member outside the class? > > BTW, if it's decided that `-fpermissive' should be necessary, I think > the error message should note that ... > > -Miles > > -- > Once, adj. Enough. > >