コンパイラの警告 (レベル 3) C4580

[attribute] は非推奨とされます。System::Attribute または Platform::Metadata を基底クラスとして指定してください

[attribute] は、ユーザー定義の属性を作成するための構文として推奨されなくなりました。 詳細については、「 User-Defined Attributes」を参照してください。 CLR コードの場合は、System::Attribute から属性を派生させます。 Windows ランタイム コードの場合は、Platform::Metadata から属性を派生させます。

次の例では、C3454 を生成し、その修正方法を示しています。

// C4580.cpp
// compile with: /W3 /c /clr
[attribute]   // C4580
public ref class Attr {
public:
   int m_t;
};

public ref class Attr2 : System::Attribute {
public:
   int m_t;
};