This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: V3 PATCH: Static data members
- To: Gabriel Dos Reis <gdr at codesourcery dot com>
- Subject: Re: V3 PATCH: Static data members
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 15 Nov 2000 23:37:41 -0200
- Cc: Mark Mitchell <mark at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, libstdc++ at sources dot redhat dot com
- Organization: GCC Team, Red Hat
- References: <20001115170202U.mitchell@codesourcery.com><xaj7l64zozg.fsf@korrigan.inria.fr>
On Nov 15, 2000, Gabriel Dos Reis <gdr@codesourcery.com> wrote:
> Mark Mitchell <mark@codesourcery.com> writes:
> | G++ doesn't handle static data members well (they are not implicitly
> | instantiated) on AIX, and it may not do so in the near future. It
> | handles *const* static data members better, because it often doesn't
> | actually allocate storage for the constants.
> Is that a conforming behaviour? static data members have external
> linkage and I would expect the compiler to allocate storage for such
> beasts.
IIRC, it *does* allocate storage when the data member is defined
(except in case of AIX and other non-ELF platforms), but it turns out
that references to static const data-members are often folded to the
constant value, so we end up not needing the out-of-line, so to speak,
definition of the static const data member.
--
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