Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 739 Bytes

compiler-error-c2364.md

File metadata and controls

31 lines (25 loc) · 739 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2364
Compiler Error C2364
11/04/2016
C2364
C2364
4f550571-94b5-42ca-84cb-663fecbead44

Compiler Error C2364

'type': illegal type for custom attribute

Named arguments for custom attributes are limited to compile time constants. For example, integral types (int, char, etc.), System::Type^, and System::Object^.

Example

The following sample generates C2364.

// c2364.cpp
// compile with: /clr /c
using namespace System;

[attribute(AttributeTargets::All)]
public ref struct ABC {
public:
   // Delete the following line to resolve.
   ABC( Enum^ ) {}   // C2364
   ABC( int ) {}   // OK
};