According to MSDN, Visual C++ can emit C4523 warning 'class' : multiple destructors specified. How is such situation even possible?
I tried the following:
class Class {
~Class();
~Class(int);
};
which yields a destructor must have a 'void' parameter list error and C4523 warning and the following
class Class {
~Class();
~Class();
};
which yields member function already defined or declared error and the following
class Class {
int ~Class();
~Class();
};
which yields a destructor cannot have a return type error.
So how do I have C4523 warning and no error?
The following causes warning C4523 but it is also preceded by an error
struct Foo
{
~Foo() {}
~Foo() const {}
};
error C2583: 'Foo::~Foo' : 'const' 'this' pointer is illegal for constructors/destructors
warning C4523: 'Foo' : multiple destructors specified
Here's another example of multiple destructors being an error, not a warning:
class C
{
~C();
~C() volatile;
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With