[cfe-dev] FunctionDecl question

Alex L via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 18 02:41:01 PDT 2017


You can look at it's type and check if it has a function prototype (i.e. it
has parameters or (void), see the FunctionProtoType class), e.g.
FD->getType()->isFunctionProtoType() .

On 18 July 2017 at 10:33, Frank Redeker via cfe-dev <cfe-dev at lists.llvm.org>
wrote:

> Hello list,
>
> is there is an easy way to distinguish if a function is declared as
>
> void foo (void);
> or
> void foo ();
>
> The reason I'm asking is that I use an ASTVisitor to generate stub
> functions. But the compiler that I use reports an error when the
> prototype is declared with (void) but the implementation not.
>
>
> Frank
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170718/4b4c82d1/attachment.html>


More information about the cfe-dev mailing list