Compiler Error C2502
'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 {};
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for