From: Ryan Flynn Date: Thu, 13 Aug 2009 01:19:23 +0000 (+0000) Subject: change cast to dyn_cast because d may not be a FunctionDecl X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7f947acd7c78c57a6ed2f43cdfb20fa597244d6;p=clang change cast to dyn_cast because d may not be a FunctionDecl git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78876 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 8a4ae3b400..d5d3840569 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -437,7 +437,7 @@ static void HandleMallocAttr(Decl *d, const AttributeList &Attr, Sema &S) { return; } - if (FunctionDecl *FD = cast(d)) { + if (FunctionDecl *FD = dyn_cast(d)) { if (!FD->getResultType()->isPointerType()) { S.Diag(Attr.getLoc(), diag::warn_attribute_malloc_pointer_only); return;