diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2008-04-18 22:43:39 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2008-04-18 22:43:39 +0000 |
commit | 59b6d5ae1c42515340a48040f6ff576a6f48a9c3 (patch) | |
tree | 90f41b4f66bc8a6cd4d649a3d1ed0ace3aad228f /lib/Sema/SemaDecl.cpp | |
parent | fa8ec62bf062eecb78b8ba68c1c1baa40e58014c (diff) |
fix __attribute__(format) for struct function pointer fields
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 015ba8c65d..e51b7974ae 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2268,10 +2268,14 @@ void Sema::HandleNothrowAttribute(Decl *d, AttributeList *rawAttr) { } static const FunctionTypeProto *getFunctionProto(Decl *d) { - ValueDecl *decl = dyn_cast<ValueDecl>(d); - if (!decl) return 0; + QualType Ty; - QualType Ty = decl->getType(); + if (ValueDecl *decl = dyn_cast<ValueDecl>(d)) + Ty = decl->getType(); + else if (FieldDecl *decl = dyn_cast<FieldDecl>(d)) + Ty = decl->getType(); + else + return 0; if (Ty->isFunctionPointerType()) { const PointerType *PtrTy = Ty->getAsPointerType(); |