summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
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
commit90964523f63cf20dd3e12c2526dedadeaf7f9ca8 (patch)
tree8dc736230a79cf008f744cd30ab8bafe2642777d /clang/lib/Sema/SemaDeclAttr.cpp
parent9b630c30408681c59bc15cae1b1e4a41138240df (diff)
downloadbcm5719-llvm-90964523f63cf20dd3e12c2526dedadeaf7f9ca8.tar.gz
bcm5719-llvm-90964523f63cf20dd3e12c2526dedadeaf7f9ca8.zip
change cast to dyn_cast because d may not be a FunctionDecl
llvm-svn: 78876
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp2
1 files changed, 1 insertions, 1 deletions
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<FunctionDecl>(d)) {
+ if (FunctionDecl *FD = dyn_cast<FunctionDecl>(d)) {
if (!FD->getResultType()->isPointerType()) {
S.Diag(Attr.getLoc(), diag::warn_attribute_malloc_pointer_only);
return;
OpenPOWER on IntegriCloud