aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Frontend/RewriteObjC.cpp2
-rw-r--r--test/Rewriter/rewrite-block-pointer.mm6
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index 9d4d604716..5d99491cd6 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/lib/Frontend/RewriteObjC.cpp
@@ -4416,7 +4416,7 @@ void RewriteObjC::RewriteCastExpr(CStyleCastExpr *CE) {
const TypeOfExprType *TypeOfExprTypePtr = cast<TypeOfExprType>(TypePtr);
QT = TypeOfExprTypePtr->getUnderlyingExpr()->getType();
std::string TypeAsString = "(";
- TypeAsString += QT.getAsString();
+ RewriteBlockPointerType(TypeAsString, QT);
TypeAsString += ")";
ReplaceText(LocStart, endBuf-startBuf+1, TypeAsString);
return;
diff --git a/test/Rewriter/rewrite-block-pointer.mm b/test/Rewriter/rewrite-block-pointer.mm
index 229eb89500..4a4fa34708 100644
--- a/test/Rewriter/rewrite-block-pointer.mm
+++ b/test/Rewriter/rewrite-block-pointer.mm
@@ -27,3 +27,9 @@ static void y(int (^cmp)(int, int)) {
x(cmp);
});
}
+
+// radar 7659483
+void *_Block_copy(const void *aBlock);
+void x(void (^block)(void)) {
+ block = ((__typeof(block))_Block_copy((const void *)(block)));
+}