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// rdar://11375908
6typedef unsigned long size_t;
7
8typedef bool BOOL;
9
10BOOL yes() {
11  return __objc_yes;
12}
13
14BOOL no() {
15  return __objc_no;
16}
17
18BOOL which (int flag) {
19  return flag ? yes() : no();
20}
21
22int main() {
23  which (__objc_yes);
24  which (__objc_no);
25  return __objc_yes;
26}
27
28void y(BOOL (^foo)());
29
30void x() {
31    y(^{
32        return __objc_yes;
33    });
34}
35