================
@@ -69,6 +69,14 @@ bool InterpState::inConstantContext() const {
InterpState::~InterpState() {
assert(Current->isBottomFrame());
+ // Invoke the dtor func of the allocated exception object block.
----------------
zwuis wrote:
It seems too late.
<details>
<summary>Reproducer</summary>
```cpp
constexpr int f() {
int n = 0;
struct D {
int *p;
constexpr D(int *p) : p(p) {}
constexpr ~D() { ++*p; }
};
try {
throw D{&n};
} catch (...) {
} // The exception object should be destroyed here.
return n;
}
static_assert(f() == 1);
```
</details>
https://github.com/llvm/llvm-project/pull/189410
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits