bolt/deps/llvm-18.1.8/clang/test/Analysis/objc-live-crash.mm
2025-02-14 19:21:04 +01:00

30 lines
365 B
Text

// RUN: %clang --analyze %s -fblocks
// https://reviews.llvm.org/D82598#2171312
@interface Item
// ...
@end
@interface Collection
// ...
@end
typedef void (^Blk)();
struct RAII {
Blk blk;
public:
RAII(Blk blk): blk(blk) {}
~RAII() { blk(); }
};
void foo(Collection *coll) {
RAII raii(^{});
for (Item *item in coll) {}
int i;
{
int j;
}
}