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

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


> 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-bugs mailing list