aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-01-26 00:45:38 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-01-26 00:45:38 +0000
commite7cff2c00c3d74e38984a4db5c48d7e303d3ab8e (patch)
treefb2cec216e64cf0a4b048db2be0658eab5ac6597 /lib/AST/ASTContext.cpp
parentceccab908bd7824751b1def127272ec04dd4732b (diff)
objc: allow block pointer matching 'id' type when
they show up as argument types of two block pointers. // rdar://10734265 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 27bbc72e88..5a7a73d3e8 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -5933,7 +5933,11 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS,
if (ETy->getDecl()->getIntegerType() == LHSCan.getUnqualifiedType())
return LHS;
}
-
+ // allow block pointer type to match an 'id' type.
+ if (OfBlockPointer && !BlockReturnType &&
+ LHS->isObjCIdType() && RHS->isBlockPointerType())
+ return LHS;
+
return QualType();
}