aboutsummaryrefslogtreecommitdiffstats
path: root/docs/checks/README-skipped-base-method.md
blob: cf4a1bdaa81d0408401fa56d7b08d4d6a28ecbcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# skipped-base-method

Warns when calling a method from the "grand-base class" instead of the base-class method.

Example:
```
class MyFrame : public QFrame
{
    Q_OBJECT
public:
    bool event(QEvent *ev) override
    {
        (...)
        return QWidget::event(ev); // warning: Maybe you meant to call QFrame::event() instead [-Wclazy-skipped-base-method]
    }
};
```

If you really need jump over the direct base-method then at least add a comment in the code, to provide intention. Or even better, a `// clazy:exclude=skipped-base-method` comment, which also silences this warning.

This check might get removed in the future, as clang-tidy recently got a similar [feature](https://clang.llvm.org/extra/clang-tidy/checks/bugprone-parent-virtual-call.html).