Akira Hatanaka 40568fec7e [CodeGen] Emit destructor calls to destruct compound literals
Fix a bug in IRGen where it wasn't destructing compound literals in C
that are ObjC pointer arrays or non-trivial structs. Also diagnose jumps
that enter or exit the lifetime of the compound literals.

rdar://problem/51867864

Differential Revision: https://reviews.llvm.org/D64464
2020-03-10 14:08:28 -07:00

11 lines
248 B
Objective-C

typedef struct {
id x;
} S;
id getObj(int c, id a) {
// Commenting out the following line because AST importer crashes when trying
// to import a BlockExpr.
// return c ? ^{ return a; }() : ((S){ .x = a }).x;
return ((S){ .x = a }).x;
}