This documentation is archived and is not being maintained.

Compiler Error C2507


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

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

identifier' : too many virtual modifiers on the base class

A class or structure is declared as virtual more than once. Only one virtual modifier can appear for each class in a list of base classes.

The following sample generates C2507:

// C2507.cpp  
// compile with: /c  
class A {};  
class B : virtual virtual public A {};   // C2507  
class C : virtual public A {};   // OK