Compiler Warning (level 3) C4240
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 Warning (level 3) C4240

Error Message

nonstandard extension used : access to 'classname' now defined to be 'access specifier', previously it was defined to be 'access specifier'

Under ANSI compatibility (/Za), you cannot change the access to a nested class. Under the default Microsoft extensions (/Ze), you can, with this warning.


// C4240.cpp
// compile with: /W3
class X
   class N;
   class N
   {   // C4240

int main()
© 2015 Microsoft