Compiler Error C3166

'pointer' : cannot declare a pointer to an interior __gc pointer as a member of 'type'

The compiler found an invalid pointer declaration (a __nogc pointer to a __gc pointer.). This syntax may be supported in a future release.

C3166 is only reachable using /clr:oldSyntax.

The following sample generates C3166:

// C3166.cpp
// compile with: /clr:oldSyntax
#using <mscorlib.dll>
using namespace System;

__gc struct G {
   int __gc* __nogc* p;   // C3166
};

public __gc class H {
public:
   Int32 __gc* __nogc* p;   // C3166
};

public __value struct I {
   int __gc* __nogc* p;   // C3166
};

public __value class J {
public:
   int __gc* __nogc* p;   // C3166
};

int main() {
   G* pG = new G;
   H* pH = new H;
}