Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C3076
Collapse the table of content
Expand the table of content

Compiler Error C3076

Error Message

'instance' : you cannot embed an instance of a reference type, 'type', in a native type

A native type cannot contain an instance of a CLR type.

For more information, see C++ Stack Semantics for Reference Types.


The following sample generates C3076.

// C3076.cpp
// compile with: /clr /c
ref struct U {};

struct V {
   U y;   // C3076

ref struct W {
   U y;   // OK

Community Additions

© 2015 Microsoft