Visual C++ Compiler Warning C4912

Message Text

'attribute': attribute has undefined behavior on a nested UDT

Severity

This is a level 1 warning.

Circumstances

As far as concerns built-in attributes, the attribute can be any except event, export, switch_is and switch_type.

For example,

struct Test
{
    [helpstring ("nested struct")]
    struct Nested {
    };
};

causes warning C4912, but

struct Test
{
    [export]
    struct Nested {
        int x;
    };
};

does not.