This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10112: static data member is not correctly initialized
- From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- To: giovannibajo at libero dot it, <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>
- Date: Mon, 17 Mar 2003 18:15:06 -0600 (CST)
- Subject: Re: c++/10112: static data member is not correctly initialized
I think with this code, A::p1 is statically initialized (being a POD
type), while B::a is dynamically initialized (having a user-defined
constructor). I think I remember that the standard specifies that static
initializers always run before dynamic ones, irrespective of the order in
which they appear in the source file. In that case, this would not be a
bug.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth at ticam dot utexas dot edu
www: http://www.ticam.utexas.edu/~bangerth/