#include typedef struct S { int x; } S; void _dtor_S(S * s); // { // printf("called destructor!\n"); // } void _ctor_S(struct S *s); // { // s->x = 123; // } int main() { struct S _tmp3; __attribute__((cleanup(_dtor_S))) struct S _tmp2 = (_ctor_S(&_tmp2), _tmp2); printf("%d\n", _tmp2.x); }