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