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.

Example

The following sample generates C2577.

// C2577.cpp
// compile with: /c
class A {
public:
   A() {}
   ~A(){
      return 0;   // C2577
   }
};