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

> 
> 
> Le 7 février 2012 19:01, Douglas Gregor <[email protected]> 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

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to