编译器错误 C3094
“attribute”:不允许匿名使用
未正确确定特性的范围。 有关更多信息,请参见 User-Defined Attributes。
示例
下面的示例生成 C3094。
// C3094.cpp
// compile with: /clr /c
using namespace System;
[AttributeUsage(AttributeTargets::Class)]
public ref class AAttribute : Attribute {};
[A]; // C3094
// OK
[A]
ref class x{};