Home | History | Annotate | Download | only in Rewriter
      1 // RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-fragile-abi %s -o %t-rw.cpp
      2 // RUN: %clang_cc1 -fsyntax-only -fms-extensions -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
      3 // RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
      4 // RUN: %clang_cc1 -fsyntax-only -fms-extensions -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
      5 // radar 8608293
      6 
      7 void *sel_registerName(const char *);
      8 
      9 extern "C" void nowarn(id);
     10 
     11 extern "C" void noblockwarn(void (^)());
     12 
     13 @interface INTFOFPROP 
     14 @property (readwrite, retain) INTFOFPROP *outer;
     15 @property (readwrite, retain) id inner;
     16 @end
     17 
     18 @interface NSSet
     19 - (NSSet *)objectsPassingTest:(char (^)(id obj, char *stop))predicate ;
     20 @end
     21 
     22 @interface INTF
     23 - (NSSet *)Meth;
     24 @end
     25 
     26 @implementation INTF
     27 
     28 - (NSSet *)Meth
     29 {
     30     NSSet *aces;
     31 
     32     noblockwarn(^() {
     33         INTFOFPROP *ace;
     34         nowarn(ace.outer.inner);
     35         noblockwarn(^() {
     36           INTFOFPROP *ace;
     37           nowarn(ace.outer.inner);
     38         });
     39     });
     40 
     41     noblockwarn(^() {
     42         INTFOFPROP *ace;
     43         nowarn(ace.outer.inner);
     44     });
     45 
     46 return [aces objectsPassingTest:^(id obj, char *stop)
     47     {
     48         INTFOFPROP *ace = (INTFOFPROP *)obj;
     49         nowarn(ace.outer.inner);
     50         return (char)0;
     51     }];
     52 
     53 }
     54 @end
     55