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

Giovanni Bajo giovannibajo@libero.it
Tue Mar 18 02:06:00 GMT 2003


The following reply was made to PR c++/10112; it has been noted by GNATS.

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: "Gabriel Dos Reis" <gdr@integrable-solutions.net>
Cc: "Wolfgang Bangerth" <bangerth@ticam.utexas.edu>,
	<gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<o.kullmann@swansea.ac.uk>,
	<nathan@gcc.gnu.org>
Subject: Re: c++/10112: static data member is not correctly initialized
Date: Tue, 18 Mar 2003 03:01:11 +0100

 ----- Original Message -----
 From: "Gabriel Dos Reis" <gdr@integrable-solutions.net>
 To: "Giovanni Bajo" <giovannibajo@libero.it>
 Cc: "Wolfgang Bangerth" <bangerth@ticam.utexas.edu>;
 <gcc-gnats@gcc.gnu.org>; <gcc-bugs@gcc.gnu.org>; <o.kullmann@swansea.ac.uk>;
 <nathan@gcc.gnu.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
 



More information about the Gcc-prs mailing list