aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Flynn <pizza@parseerror.com>2009-08-13 01:19:23 +0000
committerRyan Flynn <pizza@parseerror.com>2009-08-13 01:19:23 +0000
commitf7f947acd7c78c57a6ed2f43cdfb20fa597244d6 (patch)
tree620ba0922f8e4902911ab0062919d41f7219155e
parente82c3e269f0edd6d531b93114e97573792e808e0 (diff)
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
-rw-r--r--lib/Sema/SemaDeclAttr.cpp2
1 files changed, 1 insertions, 1 deletions
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<FunctionDecl>(d)) {
+ if (FunctionDecl *FD = dyn_cast<FunctionDecl>(d)) {
if (!FD->getResultType()->isPointerType()) {
S.Diag(Attr.getLoc(), diag::warn_attribute_malloc_pointer_only);
return;