TypeLoc of function result type?

Hi,

I want to get the TypeLoc of a FunctionDecl’s result type. I can easily get the TypeLoc of the parameters, but there seem to be no way to get the same information about the result type. What am I missing here?

Thanks!

**
Hi,

I want to get the TypeLoc of a FunctionDecl's result type. I can easily
get the TypeLoc of the parameters, but there seem to be no way to get the
same information about the result type. What am I missing here?

FD->getTypeSourceInfo().getTypeLoc().getAs<FunctionTypeLoc>()->getResultLoc()
(minus that there might be pointers in between :wink:

Cheers,
/Manuel

The result type comes from the FunctionTypeLoc, which you get from the FunctionDecl.

Jordan

Manuel, Jordan, thank you for your help! I have completely missed the fact that TypeLoc has subclasses.