This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Why is this code accepted?
- To: Mike Stump <mrs at windriver dot com>
- Subject: Re: Why is this code accepted?
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 17 Apr 2001 00:15:49 -0300
- Cc: gcc at gcc dot gnu dot org, nbecker at fred dot net
- Organization: GCC Team, Red Hat
- References: <200104162158.OAA20152@kankakee.wrs.com>
On Apr 16, 2001, Mike Stump <mrs@windriver.com> wrote:
>> To: gcc@gcc.gnu.org
>> From: nbecker@fred.net
>> Date: 16 Apr 2001 16:27:42 -0400
>> This code compiles without complaint both on gcc-2.96 and on a
>> recent gcc-3 snapshot, but doesn't link. I suspect the
>> initialization of the static "a" is invalid (I don't have a good
>> reference handy), but isn't gcc behaviour wrong?
> There was a g++ feature that allowed this to work, a while ago.
> Someone broke that feature, and didn't remove the feature from all
> places in the compiler that supported the feature. As I recall, the
> standard doesn't support this feature.
Anyway, even in the few cases in which it does allow a static const
data member to be initialized inside the class body, it still requires
the data member to be defined outside the class body, which would
probably have got you around the problem.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me