[GCC-XML]Including typedefs in the type graph.

Paul Ross paul at paulross.demon.co.uk
Mon Nov 17 17:42:09 EST 2003

At 4:17 pm -0500 17/11/03, Brad King wrote:
>Hi Paul,
>On Sun, 26 Oct 2003, Paul Ross wrote:
>>  I am using gccxml (great product by the way!) for an API documentation
>>  project and I was wondering whether it was possible to include typedef
>>  information in the graph that resolves type information.
>I've now implemented this feature and it is in the CVS version.  It seems
>to work well in most cases I've tested.  However, GCC throws away the
>typedef in the motivating example, and I have not found any way to recover
>If the function definition is not present and the typedef is the top-level
>type, GCC throws away the fact that the typedef was the type used in the
>source.  I suspect this has to do with the implementation of C++ standard
>rules about adjusting the top-level type of a function argument to remove
>cv-qualifiers and change an array type to a pointer type.  For example:
>typedef int INT;
>void foo1(INT); // references "int"
>void foo2(INT) {} // references "INT"
>void foo3(INT*); // references "pointer to INT"
>I think this is the best that can be done.  Please prove me wrong if you
>gccxml mailing list
>gccxml at gccxml.org


Thanks a lot, your solution is far more elegant than mine. It works 
on all my test cases. I can't see a flaw in your reasoning about 
whether gccxml has access to the implementation and how gcc behaves 
according to the C++ standard.



More information about the gccxml mailing list