Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error C3152

Error Message

'construct' : 'keyword' can only be applied to a class, struct, or member function

Certain keywords can only be applied to a C++ class.

The following sample generates C3152:

// C3152.cpp
// compile with: /clr /c
ref class C {
   int (*pfn)() sealed;   // C3152
   virtual int g() sealed;   // OK
};

The following sample generates C3152:

// C3152_2.cpp
// compile with: /clr:oldSyntax /c
__value __interface A {};   // C3152;
__value class X {};   // OK

Community Additions

ADD
Show:
© 2015 Microsoft