__typeof should be able to handle block pointer types when

rewriting. Fixes radar 7659483.

llvm-svn: 96549
This commit is contained in:
Fariborz Jahanian 2010-02-18 01:20:22 +00:00
parent e5ad57a3ed
commit f50679151b
2 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -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)));
}