“auto”不能与任何其他类型说明符组合
注解
类型说明符与关键字 auto 一起使用。
更正此错误
- 不要在使用
auto关键字的变量声明中使用类型说明符。
示例
下面的示例生成 C3530,因为变量 x 使用 auto 关键字和 int 类型声明,并且示例是使用 /Zc:auto 编译的。
// C3530.cpp
// Compile with /Zc:auto
int main()
{
auto int x; // C3530
return 0;
}
“auto”不能与任何其他类型说明符组合
类型说明符与关键字 auto 一起使用。
auto 关键字的变量声明中使用类型说明符。下面的示例生成 C3530,因为变量 x 使用 auto 关键字和 int 类型声明,并且示例是使用 /Zc:auto 编译的。
// C3530.cpp
// Compile with /Zc:auto
int main()
{
auto int x; // C3530
return 0;
}