Compiler Error C3421
'type' : you cannot call the finalizer for this class as it is either inaccessible or it does not exist
A finalizer is implicitly private, so it cannot be called from outside its enclosing type.
For more information, see Destructors and finalizers in How to: Define and consume classes and structs (C++/CLI).
Example
The following sample generates C3421.
// C3421.cpp
// compile with: /clr
ref class A {};
ref class B {
!B() {}
public:
~B() {}
};
int main() {
A a;
a.!A(); // C3421
B b;
b.!B(); // C3421
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for