Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 594 Bytes

compiler-error-c3156.md

File metadata and controls

26 lines (21 loc) · 594 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3156
Compiler Error C3156
11/04/2016
C3156
C3156
1876da78-b94e-4af7-9795-28f72b209b3e

Compiler Error C3156

'class' : you cannot have a local definition of a managed or WinRT type

A function cannot contain the definition, or declaration, of a managed or WinRT class, struct, or interface.

Example

The following sample generates C3156.

// C3156.cpp
// compile with: /clr /c
void f() {
   ref class X {};   // C3156
   ref class Y;   // C3156
}