You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original test program now works for me. Destructors are called when falling off the end of a scope. But destructors are not called when jumping out of a scope. This program is missing some destructor calls. Should I open a new issue for this, or reopen this one?
extern "C" int printf(char const*, ...);
struct A {
A() { printf("++A\n"); }
A(int n) { printf("++A(%d)\n", n); }
~A() { printf("--A\n"); }
};
void test(int x) {
printf("test(%d)\n", x);
A a;
if (x == 1) return;
{
A b(3);
if (x == 2) return;
}
if (x == 3) return;
}
int main() {
test(1);
test(2);
test(3);
test(4);
}
Originally posted by @dkolsen-pgi in #322 (comment)
The text was updated successfully, but these errors were encountered: