aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-01 16:29:03 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-01 16:29:03 +0000
commitafac01d7e76f28d5e5a5c377369cc400919387ee (patch)
treeb42d2d01232aae9e98bfd6953e0441e88b52176b /lib/Sema/SemaType.cpp
parent6a081405e3c8cd41ac68db9e961fe7016900ccd8 (diff)
Transfer calling-convention attributes down to member function pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 8988de8355..bb2fb99033 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1846,7 +1846,8 @@ bool ProcessFnAttr(Sema &S, QualType &Type, const AttributeList &Attr) {
// Delay if this is not a function or pointer to block.
if (!Type->isFunctionPointerType()
&& !Type->isBlockPointerType()
- && !Type->isFunctionType())
+ && !Type->isFunctionType()
+ && !Type->isMemberFunctionPointerType())
return true;
if (!GetResultType(Type)->isVoidType()) {
@@ -1868,7 +1869,8 @@ bool ProcessFnAttr(Sema &S, QualType &Type, const AttributeList &Attr) {
// Delay if this is not a function or pointer to block.
if (!Type->isFunctionPointerType()
&& !Type->isBlockPointerType()
- && !Type->isFunctionType())
+ && !Type->isFunctionType()
+ && !Type->isMemberFunctionPointerType())
return true;
// Otherwise we can process right away.
@@ -1894,6 +1896,12 @@ bool ProcessFnAttr(Sema &S, QualType &Type, const AttributeList &Attr) {
QualType T = Type;
if (const PointerType *PT = Type->getAs<PointerType>())
T = PT->getPointeeType();
+ else if (const BlockPointerType *BPT = Type->getAs<BlockPointerType>())
+ T = BPT->getPointeeType();
+ else if (const MemberPointerType *MPT = Type->getAs<MemberPointerType>())
+ T = MPT->getPointeeType();
+ else if (const ReferenceType *RT = Type->getAs<ReferenceType>())
+ T = RT->getPointeeType();
const FunctionType *Fn = T->getAs<FunctionType>();
// Delay if the type didn't work out to a function.