[GCC-XML] Re: static fields

Brad King brad.king at kitware.com
Mon Aug 23 17:34:53 EDT 2004


ivan kissiov wrote:
>     I don't know if this is GCC or GCCXML artifact, but template types 
> of static fields come incomplete in the xml output.
> 
>     template <typename T> struct A { ... }
>     class B {
>        static  A a;
>     };
>     
>     In my case A comes incomplete.

This is because the line "static A<int> a;" is a declaration for the 
member, not a definition.  Therefore there is nothing that causes A<int> 
to be instantiated so it really is an incomplete type.  If you add

A<int> B::a;

after the definition of B then it will cause the instantation of A<int> 
and it will be dumped.

>        Also, for the root specification, if I have a template class A, 
> would specifying A reach all instances, i.e. A<*>?

I'm not sure what you mean by this.  Do you mean -fxml-start=A?

-Brad



More information about the gccxml mailing list