C26434 DONT_HIDE_METHODS

"Function hides a non-virtual function."

C++ Core Guidelines

C.128: Virtual functions should specify exactly one of virtual, override, or final

Introducing a function which has the same name as a non-virtual function in a base class is like introducing a variable name which conflicts with a name from outer scope. Furthermore, if signatures of functions mismatch, the intended overriding may turn into overloading. Overall, name hiding is dangerous and error-prone.

Remarks

  • Only non-overriding functions in current class are checked.
  • Only non-virtual functions of base classes are considered.
  • No signature matching is performed. Warnings are emitted if unqualified names match.

See also

C.128: Virtual functions should specify exactly one of virtual, override, or final