编译器错误 C3277

无法在托管“type”中定义非托管枚举“enum”

在托管类型中错误地定义了枚举。

以下示例生成 C3277:

// C3277a.cpp
// compile with: /clr
ref class A
{
   enum E {e1,e2};   // C3277
   // try the following line instead
   // enum class E {e1,e2};
};

int main()
{
}