This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: V3 PATCH: Static data members


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]