1 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2 // RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
3 // RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -Wno-attributes -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
5 typedef unsigned long size_t;
7 extern "C" void *_Block_copy(const void *aBlock);
8 extern "C" void _Block_release(const void *aBlock);
12 __attribute__((__blocks__(byref))) int a = 42;
16 ((__typeof(^{ a = 2; }))_Block_copy((const void *)(^{ a = 2; })));
19 ((__typeof(b))_Block_copy((const void *)(b)));
24 // CHECK-LP: ((void (^)(void))_Block_copy((const void *)(b)))
29 __typeof__(a) aVal = a;
30 char *a1t = (char *)@encode(__typeof__(a));
31 __typeof__(aVal) bVal;
32 char *a2t = (char *)@encode(__typeof__(bVal));
33 __typeof__(bVal) cVal = bVal;
34 char *a3t = (char *)@encode(__typeof__(cVal));
42 y = (id)((__typeof(z))_Block_copy((const void *)(z)));
45 // CHECK-LP: int aVal = a;
47 // CHECK-LP: int bVal;