blob: 48c8d4023d310c1f610ab12b405bb05321d63264 [file] [log] [blame]
Fariborz Jahaniandf407c32012-04-25 20:48:00 +00001// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
NAKAMURA Takumi9ff009f2012-05-01 10:52:06 +00002// RUN: %clang_cc1 -fsyntax-only -Werror -Wno-address-of-temporary -U__declspec -D"__declspec(X)=" %t-modern-rw.cpp
Fariborz Jahaniandf407c32012-04-25 20:48:00 +00003// rdar:// 8243071
Fariborz Jahaniandf407c32012-04-25 20:48:00 +00004
Fariborz Jahanian8b08adb2012-05-03 21:44:12 +00005// rdar://11375908
6typedef unsigned long size_t;
7
Fariborz Jahaniandf407c32012-04-25 20:48:00 +00008void x(int y) {}
9void f() {
10 const int bar = 3;
11 int baz = 4;
12 __block int bab = 4;
13 __block const int bas = 5;
14 void (^b)() = ^{
15 x(bar);
16 x(baz);
17 x(bab);
18 x(bas);
19 b();
20 };
21 b();
22}