From: Fariborz Jahanian Date: Fri, 1 Apr 2011 19:19:28 +0000 (+0000) Subject: ANother rewrite bug, rewriting a call of X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=380ee502b1d91615a753dc490e1e8f83306500b6;p=clang ANother rewrite bug, rewriting a call of __byref block. // rdar://9204669 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128726 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index 54d6fbb236..88703e1917 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -4795,7 +4795,8 @@ Stmt *RewriteObjC::RewriteBlockDeclRefExpr(Expr *DeclRefExp) { // Need parens to enforce precedence. - ParenExpr *PE = new (Context) ParenExpr(SourceLocation(), SourceLocation(), + ParenExpr *PE = new (Context) ParenExpr(DeclRefExp->getExprLoc(), + DeclRefExp->getExprLoc(), ME); ReplaceStmt(DeclRefExp, PE); return PE; diff --git a/test/Rewriter/rewrite-block-pointer.mm b/test/Rewriter/rewrite-block-pointer.mm index c3876e9fa0..38a1b7da28 100644 --- a/test/Rewriter/rewrite-block-pointer.mm +++ b/test/Rewriter/rewrite-block-pointer.mm @@ -94,5 +94,6 @@ void test9204669() { addChangeToData = ^() { return 'b'; }; + addChangeToData(); }