Compiler Error C2495

'identifier' : 'nothrow' can only be applied to function declarations or definitions

The nothrow extended attribute can only be applied to function declarations or definitions. For example:

__declspec(nothrow) class X {
   int m_data;
} x;

The above code generates this error.