Export (0) Print
Expand All
Expand Minimize

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
   }
};

Community Additions

ADD
Show:
© 2014 Microsoft