summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-08-27 00:29:21 +0000
committerMike Stump <mrs@apple.com>2009-08-27 00:29:21 +0000
commita5f00ef3727f9d1bba945ed63b99584870889b6b (patch)
tree82700941703190c7f41ae1dbf7f49af165d67e14
parentf1abb5511b9dfaf79d18d975b6ccf91152f3dab8 (diff)
downloadbcm5719-llvm-a5f00ef3727f9d1bba945ed63b99584870889b6b.tar.gz
bcm5719-llvm-a5f00ef3727f9d1bba945ed63b99584870889b6b.zip
Cleanups.
llvm-svn: 80185
-rw-r--r--clang/include/clang/Basic/DiagnosticSemaKinds.td2
-rw-r--r--clang/test/Sema/block-literal.c46
2 files changed, 5 insertions, 43 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index b76b75ea46d..d376b9e68dc 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -1663,8 +1663,6 @@ def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
"cannot pass object of non-POD type %0 through variadic "
"%select{function|block|method}1; call will abort at runtime">;
-def err_typecheck_closure_too_many_args : Error<
- "too many arguments to closure call">;
def err_typecheck_call_invalid_ordered_compare : Error<
"ordered compare requires two args of floating point type (%0 and %1)">;
def err_typecheck_cond_expect_scalar : Error<
diff --git a/clang/test/Sema/block-literal.c b/clang/test/Sema/block-literal.c
index 19d476fc294..c4aadd5d488 100644
--- a/clang/test/Sema/block-literal.c
+++ b/clang/test/Sema/block-literal.c
@@ -8,7 +8,7 @@ int printf(const char*, ...);
typedef void (^T) (void);
-void takeclosure(T);
+void takeblock(T);
int takeintint(int (^C)(int)) { return C(4); }
T somefunction() {
@@ -26,10 +26,10 @@ T somefunction() {
void test2() {
int x = 4;
- takeclosure(^{ printf("%d\n", x); });
+ takeblock(^{ printf("%d\n", x); });
while (1) {
- takeclosure(^{
+ takeblock(^{
break; // expected-error {{'break' statement not in loop or switch statement}}
continue; // expected-error {{'continue' statement not in loop statement}}
while(1) break; // ok
@@ -39,9 +39,9 @@ void test2() {
}
foo:
- takeclosure(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}}
+ takeblock(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}}
__block y = 7; // expected-warning {{type specifier missing, defaults to 'int'}}
- takeclosure(^{ y = 8; });
+ takeblock(^{ y = 8; });
}
@@ -86,39 +86,3 @@ typedef void (^void_block_t)(void);
static const void_block_t myBlock = ^{ };
static const void_block_t myBlock2 = ^ void(void) { };
-
-#if 0
-// Old syntax. FIXME: convert/test.
-void test_byref() {
- int i;
-
- X = ^{| g |}; // error {{use of undeclared identifier 'g'}}
-
- X = ^{| i,i,i | };
-
- X = ^{|i| i = 0; };
-
-}
-
-// TODO: global closures someday.
-void *A = ^{};
-void *B = ^(int){ A = 0; };
-
-
-// Closures can not take return types at this point.
-void test_retvals() {
- // Explicit return value.
- ^int{}; // error {{closure with explicit return type requires argument list}}
- X = ^void(){};
-
- // Optional specification of return type.
- X = ^char{ return 'x'; }; // error {{closure with explicit return type requires argument list}}
-
- X = ^/*missing declspec*/ *() { return (void*)0; };
- X = ^void*() { return (void*)0; };
-
- //X = ^char(short c){ if (c) return c; else return (int)4; };
-
-}
-
-#endif
OpenPOWER on IntegriCloud