[cfe-commits] r56770 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/Sema/block-args.c
Steve Naroff
snaroff at apple.com
Sun Sep 28 07:02:57 PDT 2008
Author: snaroff
Date: Sun Sep 28 09:02:55 2008
New Revision: 56770
URL: http://llvm.org/viewvc/llvm-project?rev=56770&view=rev
Log:
Fix <rdar://problem/6252108> assigning to argument passed to block should not require __block.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/Sema/block-args.c
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=56770&r1=56769&r2=56770&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Sun Sep 28 09:02:55 2008
@@ -436,7 +436,7 @@
// things like "integer constant expression" tests.
//
if (!CurBlock || DeclDefinedWithinScope(VD, CurBlock->TheScope, S) ||
- isa<EnumConstantDecl>(VD))
+ isa<EnumConstantDecl>(VD) || isa<ParmVarDecl>(VD))
return new DeclRefExpr(VD, VD->getType(), Loc);
// If we are in a block and the variable is outside the current block,
Modified: cfe/trunk/test/Sema/block-args.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-args.c?rev=56770&r1=56769&r2=56770&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-args.c (original)
+++ cfe/trunk/test/Sema/block-args.c Sun Sep 28 09:02:55 2008
@@ -22,3 +22,8 @@
^(int x, ...){return 5;}(arg, arg); // Explicit varargs, ok.
}
+int main(int argc) {
+ ^(int argCount) {
+ argCount = 3;
+ }(argc);
+}
More information about the cfe-commits
mailing list