From 90964523f63cf20dd3e12c2526dedadeaf7f9ca8 Mon Sep 17 00:00:00 2001 From: Ryan Flynn Date: Thu, 13 Aug 2009 01:19:23 +0000 Subject: change cast to dyn_cast because d may not be a FunctionDecl llvm-svn: 78876 --- clang/lib/Sema/SemaDeclAttr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang') diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 8a4ae3b4005..d5d3840569b 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/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; -- cgit v1.2.3