Compiler Error C3749
TOC
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error C3749

'attribute': a custom attribute may not be used inside a function

A custom attribute cannot be used inside a function. (For more information on custom attributes, see the topic attribute.)

The following sample generates C3749:

// C3749.cpp
// compile with: /clr
#using <mscorlib.dll>
using namespace System;

[attribute(All)]
public __gc struct ABC {
   ABC() {
   }
};

void f1() {
   [ABC];   // C3749
};

int main() {
}
Show:
© 2016 Microsoft