Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 783 Bytes

compiler-warning-level-3-c4240.md

File metadata and controls

33 lines (28 loc) · 783 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 3) C4240
Compiler Warning (level 3) C4240
11/04/2016
C4240
C4240
a2657cdb-18e1-493f-882b-4e10c0bca71d

Compiler Warning (level 3) C4240

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.

Example

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

int main()
{
}