[cfe-dev] Is it possible to get parmvardecl from vardecl of function type when AST is constructed?

Ding Fei via cfe-dev cfe-dev at lists.llvm.org
Tue Jan 30 01:29:43 PST 2018


Hi all,

I'm developing a clang-tidy plugin to check whether function decls
have proper prototypes.
Like

    int (* copy)(int src, int dest);

It's not clear what the function does when parameter names are omitted.

For VarDecl of form:

    int (* copy)(int, int);

AST dump gives:

    VarDecl 0x204c1b0 <1.c:1:1, col:21> col:7 copy 'int (*)(int, int)'

is it possible to get parameter info from the constructed AST,
especially whether the params
have ids?

-- 
Best Regards

Ding Fei
E-mail: danix800 at gmail.com



More information about the cfe-dev mailing list