Compiler Error C3826
Collapse the table of content
Expand the table of content
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. ArchiveDisclaimer

Compiler Error C3826

'type': declaring pinned formal parameters is illegal

A function parameter cannot be decorated with the __pin keyword.

C3826 is only reachable using /clr:oldSyntax.

The following sample generates C3826:

// C3826.cpp
// compile with: /clr:oldSyntax /c
__gc class G {};

typedef G __pin * GPinPtrType;
typedef G * GPinPtrType2;

void func1(G __pin * x) {}   // C3826
void func1b(G * x) {}   // OK

void func2(GPinPtrType x) {}   // C3826
void func2(GPinPtrType2 x) {}   // OK
© 2016 Microsoft