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
If I create an automatic variable with an array of objects that require a destructor call, the elements are incorrect destructed from first to last. They should be destructed in reverse order.
Reproducer:
#include <iostream>
int count = 0;
struct S {
int i;
S() {
i = count++;
std::cout << "S ctor, i = " << i << "\n";
}
~S() {
std::cout << "S dtor, i = " << i << "\n";
}
};
int main() {
S s[10];
return 0;
}
(Note: As of the time I submitted this issue, only one element gets constructed or destructed. Hopefully, the link above will show the problem after #1758 is merged.)