Compiler bug?

Martin Sebor sebor@roguewave.com
Tue Apr 8 17:09:00 GMT 2003


Nathan Myers wrote:
...
> Hm, I didn't think C99 had static members.  Here's a simpler case:

FWIW, this (or something very close to it) was discussed in
c++std-core-9276 (attached). From John Spicer's response it
sounds like a potential defect but I'm not sure anyone opened
an issue for it.

Regards
Martin

> 
>   template<typename T> 
>     struct Foo
>     {
>         int c;
>         static int s[];
>     };
> 
>   template<typename T>
>     int Foo<T>::s[sizeof(Foo<T>)];
> 
>   int* p = Foo<char>::s;
> 
> Nathan Myers
> ncm-nospam@cantrip.org


-------------- next part --------------
An embedded message was scrubbed...
From: "John H. Spicer" <jhs@edg.com>
Subject: Re: can't take sizeof a static const data member of a template
Date: Mon, 30 Jul 2001 09:31:56 -0400
Size: 6229
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030408/7cc56ca5/attachment.eml>


More information about the Libstdc++ mailing list