Deducation and instantiation of block types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73232 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index fe64946..0bef27c 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -433,6 +433,21 @@
Deduced);
}
+ // type(^)(T)
+ // T(^)()
+ // T(^)(T)
+ case Type::BlockPointer: {
+ const BlockPointerType *BlockPtrParam = cast<BlockPointerType>(Param);
+ const BlockPointerType *BlockPtrArg = dyn_cast<BlockPointerType>(Arg);
+
+ if (!BlockPtrArg)
+ return false;
+
+ return DeduceTemplateArguments(Context,
+ BlockPtrParam->getPointeeType(),
+ BlockPtrArg->getPointeeType(), Deduced);
+ }
+
case Type::TypeOfExpr:
case Type::TypeOf:
case Type::Typename: