编译器警告(等级 2)C4099

“identifier”:类型名称以前使用“objecttype1”现在使用的是“objecttype2”

声明为结构的对象定义为类,或者声明为类的对象定义为结构。 编译器使用定义中给定的类型。

示例

以下示例生成 C4099。

// C4099.cpp
// compile with: /W2 /c
struct A;
class A {};   // C4099, use different identifer or use same object type