c++/7934: definition of static member for template class miss ing in obj file

Wolfgang Bangerth bangerth@ticam.utexas.edu
Wed Dec 4 07:06:00 GMT 2002


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

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: "Gu, Michael" <Michael_Gu@maxtor.com>
Cc: "'gcc-bugs@gcc.gnu.org'" <gcc-bugs@gcc.gnu.org>,
   "'mkjyg@charter.net'" <mkjyg@charter.net>,
   "'gcc-gnats@gcc.gnu.org'" <gcc-gnats@gcc.gnu.org>
Subject: RE: c++/7934: definition of static member for template class miss
 ing in obj file
Date: Wed, 4 Dec 2002 09:00:11 -0600 (CST)

 > template <class T>
 > class A
 > {
 >   static T * instance;
 > };
 > 
 > template <class T>
 > T * instance=0;
 
 Did you mean
   T * A::instance = 0;
 ?? The code you sent does not compile (and should not), and is also not 
 what you want.
 
 
 > The same gcc on Sun works for this. So I guess this might be a library
 > problem for HP compatibility.
 
 Yes, maybe. I have seen another report in this form before.
 
 Regards
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 



More information about the Gcc-prs mailing list