[GCC-XML] GCC-XML 0.9 - another difference

Brad King brad.king at kitware.com
Sun Nov 11 20:28:52 EST 2007


Roman Yakovenko wrote:
> struct mem_var_str_t{
>     static std::string class_name;
>     std::string identity(std::string x){ return x; }
> };
> Gccxml 0.7 reports correctly type of "x", while gccxml 0.9 reports it 
> as: "restrict & string".
> 
> It does this for std and user defined classes passed by value.

I've reproduced it with minimal code:

struct A { ~A(); };
struct B {
   void f(A x) {}
};

It happens when non-POD types are passed by value into the *definition* 
of a function.  I found something in GCC's code about "invisible 
references".  There is a predicate macro provided to detect them.  I've 
committed a fix:

/cvsroot/GCC_XML/gccxml/GCC/gcc/cp/xml.c,v  <--  xml.c
new revision: 1.118; previous revision: 1.117

-Brad




More information about the gccxml mailing list