Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 1022 Bytes

compiler-warning-level-3-c4580.md

File metadata and controls

32 lines (26 loc) · 1022 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 3) C4580
Compiler Warning (level 3) C4580
11/04/2016
C4580
C4580
fef6e8e0-0d6a-44fa-b22a-2fe7ba2ef379

Compiler Warning (level 3) C4580

[attribute] is deprecated; instead specify System::Attribute or Platform::Metadata as a base class

[attribute] is no longer the preferred syntax for creating user-defined attributes. For more information, see User-Defined Attributes. For CLR code, derive attributes from System::Attribute. For Windows Runtime code, derive attributes from Platform::Metadata.

Example

The following sample generates C3454 and shows how to fix it.

// 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;
};