45 lines · plain
1// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp2// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp3 4extern "C" void *sel_registerName(const char *);5typedef unsigned long size_t;6 7union U {8 double d1;9 char filler[32];10};11 12struct S {13 char filler[128];14};15 16@interface I17- (struct S) Meth : (int) arg1 : (id) arg2;18- (struct S) Meth1;19- (union U) Meth2 : (double)d;20- (struct S) VAMeth : (int)anchor, ...;21@end22 23I* PI();24 25extern "C" {26 27struct S foo () {28 struct S s = [PI() Meth : 1 : (id)0];29 30 U u = [PI() Meth2 : 3.14];31 32 S s1 = [PI() VAMeth : 12, 13.4, 1000, "hello"];33 34 S s2 = [PI() VAMeth : 12];35 36 S s3 = [PI() VAMeth : 0, "hello", "there"];37 38 S s4 = [PI() VAMeth : 2, ^{}, &foo];39 40 return [PI() Meth1];41}42 43}44 45