Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
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.

Compiler Error C2502

Error Message

'identifier' : too many access modifiers on the base class

The base class has more than one access modifier. Only one access modifier (public, private, or protected) is allowed.

The following sample generates C2502:

// C2502.cpp
// compile with: /c
class A { };
class B { };
class C : private public A { };   // C2502

// OK
class D : private A {};
class E : public A, private B {};

Community Additions

ADD
Show:
© 2015 Microsoft