[cfe-commits] r78862 - /cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Eli Friedman eli.friedman at gmail.com
Wed Aug 12 16:56:15 PDT 2009


On Wed, Aug 12, 2009 at 4:53 PM, Ryan Flynn<parseerror at gmail.com> wrote:
> On Wed, Aug 12, 2009 at 7:49 PM, Eli Friedman<eli.friedman at gmail.com> wrote:
>> On Wed, Aug 12, 2009 at 4:36 PM, Ryan Flynn<pizza at parseerror.com> wrote:
>>> --- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
>>> +++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Aug 12 18:36:28 2009
>>> @@ -437,7 +437,7 @@
>>>     return;
>>>   }
>>>
>>> -  if (FunctionDecl *FD = dyn_cast<FunctionDecl>(d)) {
>>> +  if (FunctionDecl *FD = cast<FunctionDecl>(d)) {
>>>     if (!FD->getResultType()->isPointerType()) {
>>>       S.Diag(Attr.getLoc(), diag::warn_attribute_malloc_pointer_only);
>>>       return;
>>
>> Is there actually any guarantee the decl in question is a function decl?
>>
>> -Eli
>>
>
> Eli,
>
> The block above it returns if (!isFunctionOrMethod(d)).
>
> Ryan

But that doesn't guarantee it's a FunctionDecl, no?

-Eli




More information about the cfe-commits mailing list