C++ standard at 12.4.2 states that
[...] The address of a destructor shall not be taken. [...]
However, one can without any complaints by the compiler take the address of a wrapper around a class destructor, like this:
struct Test {
~Test(){};
void destructor(){
this->~Test();
}
};
void (Test::*d)() = &Test::destructor;
So what's the rationale behind forbidding to take the address of a destructor directly?
Constructors and destructors are somewhat special. The compiler often uses different conventions when calling them (e.g. to pass extra hidden arguments). If you took the address and saved it somewhere, the compiler would lose the information that the function is a constructor or destructor, and would not know to use the special conventions.