This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: c++/10112: static data member is not correctly initialized


----- Original Message -----
From: "Gabriel Dos Reis" <gdr at integrable-solutions dot net>
To: "Giovanni Bajo" <giovannibajo at libero dot it>
Cc: "Wolfgang Bangerth" <bangerth at ticam dot utexas dot edu>;
<gcc-gnats at gcc dot gnu dot org>; <gcc-bugs at gcc dot gnu dot org>; <o dot kullmann at swansea dot ac dot uk>;
<nathan at gcc dot gnu dot org>
Sent: Tuesday, March 18, 2003 2:46 AM
Subject: Re: c++/10112: static data member is not correctly initialized


>From which parts of the standard did read that?

I was reading §3.6.2p1 <<before any other initialization takes place>> in
this way.
Anyway, the bug is about the order of initialization between two static data
members. Since instantiation of class templates does not affect
initialization of static data members (as per quoted paragraph), even if you
instantiate the class templates before inizializing the data members, you
should respect the order of inizialization of the data members.
It seems to me that GCC is initializing the static data members because the
templates are instantiated, but this violates §14.7.1p8.

Giovanni Bajo


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