File: README-skipped-base-method.md

package info (click to toggle)
clazy 1.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,248 kB
  • sloc: cpp: 23,552; python: 1,450; xml: 450; sh: 237; makefile: 45
file content (21 lines) | stat: -rw-r--r-- 762 bytes parent folder | download | duplicates (6)
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 one.

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).