Compiler Error C2577
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C2577.
member' : destructor/finalizer cannot have a return type
A destructor or finalizer cannot return a value of void or any other type. Remove the return statement from the destructor definition.
The following sample generates C2577.
// C2577.cpp
// compile with: /c
class A {
public:
A() {}
~A(){
return 0; // C2577
}
};
Show: