[cfe-commits] [PATCH] Handle format_arg attribute on CXX instance members

Jean-Daniel Dupas devlists at shadowlab.org
Tue Feb 7 11:06:50 PST 2012


Le 7 févr. 2012 à 19:31, Matthieu Monrocq a écrit :

> 
> 
> Le 7 février 2012 19:01, Douglas Gregor <dgregor at apple.com> a écrit :
> 
> On Feb 6, 2012, at 2:05 PM, Jean-Daniel Dupas wrote:
> 
> > Ping.
> 
> It looks okay, except that this:
> 
> +    if (const NamedDecl *ND = dyn_cast<NamedDecl>(CE->getCalleeDecl())) {
> +      if (const FormatArgAttr *FA = ND->getAttr<FormatArgAttr>()) {
> 
> assumes that CE->getCalleeDecl() can never return NULL. That's not generally the case, because the call could be a call to (say) a function pointer.
> 
>        - Doug
> 
> Which in case you do not know, means that Doug says you should be using dyn_cast_or_null<> which checks for the nullity of the passed in argument.

Thank you for the pointer :-)

Applied with the suggested change. (r149998)

-- Jean-Daniel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120207/c5f02041/attachment.html>


More information about the cfe-commits mailing list