As per your requirement, following code works well
#include <iostream>
class A
{
public:
A() { }
~A() { std::cout<<"\n ~A()"; }
};
int main()
{
A a;
a.A::~A();
return 0;
}
But beware of Calling the D'tor explicitly. Because compiler will insert the code for an auto obejcts that are inside the function. In the above code will result in calling the D'tor twice i.e
int main()
{
A a;
a.A::~(); //which we provided
a.A::~(); // provided by the compiler for auto objects
return 0;
}
We have to explicitly call the D'tor only for the placment new operator here for more details.