编译器错误 C3100
“target”:未知的特性限定符
指定了无效的特性目标。
有关更多信息,请参见 User-Defined Attributes。
示例
下面的示例生成 C3100。
// C3100.cpp
// compile with: /clr /c
using namespace System;
[AttributeUsage(AttributeTargets::All)]
public ref class Attr : public Attribute {
public:
Attr(int t) : m_t(t) {}
int m_t;
};
[invalid_target:Attr(10)]; // C3100
[assembly:Attr(10)]; // OK
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈