This is slightly controversial, please hold me back / bikeshed if you don't like it.
The optin.cplusplus.VirtualCall checker in its current shape was implemented by @wangxindsb during his GSoC'2017 project - see D34275. It is a path-sensitive checker that finds calls to virtual functions during construction and destruction. This is a problem because virtual dispatch won't occur during construction or destruction. In particular, if the function is pure virtual, it is outright undefined behavior; in other cases it is simply an unexpected behavior. The checker has an option PureOnly to control whether the user is only interested in calls to pure virtual functions. It defaults to false, i.e. warn on non-pure-virtual calls as well.
I propose the following changes:
- Remove the option.
- Instead, split the checker in two:
- cplusplus.PureVirtualCall will only check pure virtual calls and it will be on by default.
- optin.cplusplus.VirtualCall will check all calls and will remain opt-in under the old name. It would automatically load cplusplus.PureVirtualCall.
- Additionally, remove the bug visitor. The reasons for that have been described in D34275?id=111862#inline-321253: essentially, the visitor doesn't add any new interesting information to the report. It's also currently broken: it places its note in a really weird spot.
I'd like to point out that it breaks backwards compatibility. I'm not going to be hurt by this and i haven't heard a lot about users of this opt-in check but if you know them, please let me know. If we agree to break backwards compatibility, we should make sure that the result is the best, so i'd like to hear @Szelethus's opinion, as he usually has strong opinions on checker options and dependencies :)
See also http://lists.llvm.org/pipermail/cfe-dev/2018-December/060558.html (the thread was bumped recently)