“symbol”:“__declspec(modifer)”只能应用于全局对象或静态数据成员的声明或定义
在函数中使用了设计为仅在全局范围内使用的 __declspec
修饰符。
以下示例生成 C2505:
// C2505.cpp
// compile with: /clr
// OK
__declspec(process) int ii;
__declspec(appdomain) int jj;
int main() {
__declspec(process) int i; // C2505
__declspec(appdomain) int j; // C2505
}