1 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp 2 // RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"__declspec(X)=" %t-rw.cpp 3 // rdar://11231426 4 5 typedef bool BOOL; 6 7 BOOL yes() { 8 return __objc_yes; 9 } 10 11 BOOL no() { 12 return __objc_no; 13 } 14 15 BOOL which (int flag) { 16 return flag ? yes() : no(); 17 } 18 19 int main() { 20 which (__objc_yes); 21 which (__objc_no); 22 return __objc_yes; 23 } 24 25 void y(BOOL (^foo)()); 26 27 void x() { 28 y(^{ 29 return __objc_yes; 30 }); 31 } 32