Re: Fw: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Ian Lance Taylor
Andrew Pinski writes: > On Mon, Nov 29, 2010 at 4:20 PM, Ian Lance Taylor wrote: >> 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 >

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Gabriel Dos Reis
On Tue, Nov 30, 2010 at 9:07 AM, Miles Bader wrote: >> If people are worried about multiple translation units, they >> will still have to provide a definition outside the class -- most >> likely > > Why? Because its address may be silently taken (through binding to references), therefore a defin

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Miles Bader
On Tue, Nov 30, 2010 at 11:40 PM, Gabriel Dos Reis wrote: > I agree.  I think we have a case here where people will > say anything to justify a (mis)feature that leads to brittle > codes Why does it "lead to brittle codes"? > If people are worried about multiple translation units, they > will st

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Gabriel Dos Reis
On Tue, Nov 30, 2010 at 5:39 AM, Richard Guenther wrote: > On Tue, Nov 30, 2010 at 9:17 AM, Miles Bader wrote: >> On Tue, Nov 30, 2010 at 5:13 PM, Gabriel Dos Reis >> wrote: >>> If you are doing that, why don't you write a simpler code by >>> just defining (e.g. initializing) the data member out

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Roman Kononov
On 2010-11-29, 22:26:31 -0800, Andrew Pinski wrote: > > Except it is documented as a Deprecated feature already so it is > different from a documented extension. I would say we should just > drop it as it is documented already as deprecated. Are you going to drop the feature from g++98? It is

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Miles Bader
Richard Guenther writes: >>> 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? >> >> 'cause I want the compiler to be able to use (inline) the underlying values. > > I think it'll do that with initializing the memb

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Marc Glisse
On Tue, 30 Nov 2010, Richard Guenther wrote: On Tue, Nov 30, 2010 at 9:17 AM, Miles Bader wrote: On Tue, Nov 30, 2010 at 5:13 PM, Gabriel Dos Reis wrote: 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? 'cause

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Richard Guenther
On Tue, Nov 30, 2010 at 9:17 AM, Miles Bader wrote: > On Tue, Nov 30, 2010 at 5:13 PM, Gabriel Dos Reis > wrote: >> 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? > > 'cause I want the compiler to be able to use

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Miles Bader
Gabriel Dos Reis writes: >> I.e., I can choose between various types of ugliness -- wrong namespace, >> funny syntax, or (currently) gcc-dependence.  I used to choose gcc- >> dependence, but then switched to funny syntax.  In the future when c++0x >> support is more widespread, of course, I won't

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Gabriel Dos Reis
On Tue, Nov 30, 2010 at 2:33 AM, Miles Bader wrote: > Gabriel Dos Reis writes: 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? >>> >>> 'cause I want the compiler to be able to use (inline) the underlying v

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Miles Bader
Gabriel Dos Reis writes: >>> 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? >> >> 'cause I want the compiler to be able to use (inline) the underlying values. > > then write even simple code: dispense with the c

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Gabriel Dos Reis
On Tue, Nov 30, 2010 at 2:17 AM, Miles Bader wrote: > On Tue, Nov 30, 2010 at 5:13 PM, Gabriel Dos Reis > wrote: >> 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? > > 'cause I want the compiler to be able to use

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Miles Bader
On Tue, Nov 30, 2010 at 5:13 PM, Gabriel Dos Reis wrote: > 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? 'cause I want the compiler to be able to use (inline) the underlying values. -Miles -- Cat is power.  C

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-30 Thread Gabriel Dos Reis
On Mon, Nov 29, 2010 at 11:51 PM, Miles Bader wrote: > Ian Lance Taylor 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 >>

Re: Fw: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-29 Thread Andrew Pinski
On Mon, Nov 29, 2010 at 4:20 PM, Ian Lance Taylor wrote: > 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

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-29 Thread Miles Bader
Ian Lance Taylor 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 fo

Re: Fw: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-29 Thread Ian Lance Taylor
Gabriel Dos Reis writes: > On Mon, Nov 29, 2010 at 3:24 PM, Roman Kononov wrote: >> $ cat test.cc >> struct X { static float const v=1; }; >> >> $ g++ -c -std=gnu++0x test.cc >> test.cc:1:33: error: 'constexpr' needed for in-class initialization of >> static data member 'v' of non-integral type

Re: Fw: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-29 Thread Gabriel Dos Reis
On Mon, Nov 29, 2010 at 3:24 PM, Roman Kononov wrote: > $ cat test.cc > struct X { static float const v=1; }; > > $ g++ -c -std=gnu++0x test.cc > test.cc:1:33: error: 'constexpr' needed for in-class initialization of > static data member 'v' of non-integral type > > This will break a great deal of

Re: Fw: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-29 Thread Marc Glisse
On Mon, 29 Nov 2010, Andrew Pinski wrote: On Mon, Nov 29, 2010 at 1:24 PM, Roman Kononov wrote: $ cat test.cc struct X { static float const v=1; }; $ g++ -c -std=gnu++0x test.cc test.cc:1:33: error: 'constexpr' needed for in-class initialization of static data member 'v' of non-integral type

Re: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-29 Thread Roman Kononov
2010-11-29 13:25 CST, Andrew Pinski wrote: >well this code is not valid C++03 code to begin with. I agree. I mean "existing gnu++" if you will.

Re: Fw: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-29 Thread Andrew Pinski
On Mon, Nov 29, 2010 at 1:24 PM, Roman Kononov wrote: > $ cat test.cc > struct X { static float const v=1; }; > > $ g++ -c -std=gnu++0x test.cc > test.cc:1:33: error: 'constexpr' needed for in-class initialization of > static data member 'v' of non-integral type > > This will break a great deal of

Fw: new requirement of "constexpr" for static const float data members is too restrictive

2010-11-29 Thread Roman Kononov
$ cat test.cc struct X { static float const v=1; }; $ g++ -c -std=gnu++0x test.cc test.cc:1:33: error: 'constexpr' needed for in-class initialization of static data member 'v' of non-integral type This will break a great deal of existing c++ code preventing easy transition to c++0x. Maybe, the