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
#include<stdio.h>structS { ~S() { puts("~S"); } };
intmain() {
for (int i = 0; i < 4; i++) {
S s;
}
}
CIR calls the destructor at the end of the for loop (including when exiting it with a break) instead of inside it. This is kinda like the opposite of #348; in this case, the destructor is called when jumping out of a scope but not when exiting and resuming it normally.
The text was updated successfully, but these errors were encountered:
https://godbolt.org/z/bdqM4ccxf demonstrates the issue. For the following code:
CIR calls the destructor at the end of the for loop (including when exiting it with a
break
) instead of inside it. This is kinda like the opposite of #348; in this case, the destructor is called when jumping out of a scope but not when exiting and resuming it normally.The text was updated successfully, but these errors were encountered: