xref: /llvm-project/clang/test/Rewriter/rewrite-modern-block-consts.mm (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
2// RUN: %clang_cc1 -fsyntax-only -Werror -Wno-address-of-temporary -U__declspec -D"__declspec(X)=" %t-modern-rw.cpp
3
4typedef unsigned long size_t;
5
6void x(int y) {}
7void f() {
8    const int bar = 3;
9    int baz = 4;
10    __block int bab = 4;
11    __block const int bas = 5;
12    void (^b)() = ^{
13        x(bar);
14        x(baz);
15        x(bab);
16        x(bas);
17        b();
18    };
19    b();
20}
21