[cfe-dev] HOWTO: use a CXCursor referring a Typedef

Douglas Gregor dgregor at apple.com
Mon Jan 24 10:49:34 PST 2011

On Jan 21, 2011, at 1:06 PM, Stefan Seefeld wrote:

> I'm trying to access the newly defined type (CXType), as well as the 
> aliased type, starting from a CXCursor of kind CXCursor_TypedefDecl.

There isn't an API to access just the aliased type as it was written. You can use clang_getCanonicalType() to get down to the canonical form of the type. I'd be fine with adding some kind of clang_getDesugaredType() operation to desugar a given type by one step.

> Calling clang_getCursorType() on that cursor yields a type of kind 
> "Invalid". Is that a bug or am I using the wrong function ?

That's a bug I just fixed in r124133. Thanks!

	- Doug

More information about the cfe-dev mailing list