Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 2.11 KB

compiler-error-c3409.md

File metadata and controls

65 lines (45 loc) · 2.11 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3409
Compiler Error C3409
11/06/2018
C3409
C3409
e372d9fa-230c-4b28-b6d3-6ad81ccf9dbb

Compiler Error C3409

empty attribute block is not allowed

Remarks

The square brackets were interpreted by the compiler as an attribute block, but no attributes were found.

The compiler may generate this error when you use square brackets as part of the definition of a lambda expression. This error occurs when the compiler cannot determine whether the square brackets are part of the definition of a lambda expression or of an attribute block. For more information about lambda expressions, see Lambda Expressions.

To correct this error

  1. If the square brackets are part of an attribute block:

    1. Provide one or more attributes in the attribute block.

    2. Remove the attribute block.

  2. If the square brackets are part of a lambda expression, make sure that the lambda expression follows valid syntax rules.

    For more information about lambda expression syntax, see Lambda Expression Syntax.

Examples

The following example generates C3409.

// C3409.cpp
// compile with: /c
#include <windows.h>
[]   // C3409
class a {};

// OK
[object, uuid("00000000-0000-0000-0000-000000000000")]
__interface x {};

[coclass, uuid("00000000-0000-0000-0000-000000000001")]
class b : public x {};

The following example generates C3409 because a lambda expression uses the mutable specification, but does not provide a parameter list. The compiler cannot determine whether the square brackets are part of the definition of a lambda expression or of an attribute block.

// C3409b.cpp

int main()
{
   [] mutable {}();
}

See also

attribute
Lambda Expressions
Lambda Expression Syntax