Compiler Error C3769

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3769.

type' : a nested class cannot have the same name as the immediately enclosing class

A nested class cannot have the same name as the immediately enclosing class.

The following sample generates C3769.

// C3769.cpp  
// compile with: /c  
class x {  
   class x {};   // C3769  
   class y {  
      class x{};   // OK  
   };  
};  

Show: