| 1 |
.. title:: clang-tidy - bugprone-virtual-near-miss |
| 2 |
|
| 3 |
bugprone-virtual-near-miss |
| 4 |
========================== |
| 5 |
|
| 6 |
Warn if a function is a near miss (i.e. the name is very similar and the function |
| 7 |
signature is the same) to a virtual function from a base class. |
| 8 |
|
| 9 |
Example: |
| 10 |
|
| 11 |
.. code-block:: c++ |
| 12 |
|
| 13 |
struct Base { |
| 14 |
virtual void func(); |
| 15 |
}; |
| 16 |
|
| 17 |
struct Derived : Base { |
| 18 |
virtual void funk(); |
| 19 |
// warning: 'Derived::funk' has a similar name and the same signature as virtual method 'Base::func'; did you mean to override it? |
| 20 |
}; |