[cfe-dev] Retrieving names from function type decl

Brittany Friedman via cfe-dev cfe-dev at lists.llvm.org
Mon Jul 29 17:22:43 PDT 2019


Hello,

I am writing a clang tool, using a build of clang from March ish.
I have some input code like the following:

using handler = void(*)(int a);

I seem to be unable to retrieve the name "a" from the TypeAliasDecl.
dump()ing it seems to give all the correct hierarchy information except for
the missing names.

I believe that I need a ValueDecl in order for this to work, since these
parameter names are obviously not part of the type, but so far I haven't
been able to find one.

The same issue appears when using templates, like:
std::function<void(int a)>

Any information that could point me in the right direction or help me to
reconstitute the missing information would be appreciated.
Thank you,
Brittany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190729/3548534b/attachment.html>


More information about the cfe-dev mailing list