After playing with placement new / delete, I came up with this piece of code, which, surprinsingly for me, compiles and runs (at least on gcc and clang):
int main()
{
struct A{};
A a;
const A& b = a;
b.~A();
}
I have tested more complex versions, for instance where the destructor of A calls members which are not const qualified. Is there a good reason for this ability to call destructor from const references?