Adding an access specifier that matches the class' current access level needlessly clutters the code.


== Noncompliant Code Example

----
struct B {
};

struct S : public B { // Noncompliant; "struct" has public access for its base classes by default
};

class C : private B { // Noncompliant; "class" has private access for its base classes by default
};
----


== Compliant Solution

----
struct B {
};

struct S : B {
};

class C : B {
};
----

=== See Also

* S5965 and S5966 are other rules that favor different coding style for base classes. They should not be activated at the same time as this rule.


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
