Summary: | Allow visiting of implicit code | ||
---|---|---|---|
Product: | [Developer tools] clazy | Reporter: | Richard <richard.oehlinger> |
Component: | general | Assignee: | Sergio Martins <smartins> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | smartins |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | All | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Minimal patch |
By implicit CTORs you mean the compiler-synthesized ones ? Which clazy check would find anything interesting in there ? We've an in-house check for a 3rdparty library which we cannot control to flag default construction of several types: //in thirdpartylib.h class DoNotDefaultConstruct { //.... } //in our code DoNotDefaultConstruct c; // will be flagged as intended struct SomeStruct { DoNotDefaultConstruct c; } inst; //should be flagged, but won't It makes things considerably slower (11m vs 15m to build qtbase), so I'll add an opt-in option to enable it commit ec9ec84e7fd73f5a4753973660ad4f301eaa8c0e (HEAD -> master, origin/master) Author: Sergio Martins <smartins@kde.org> Date: Thu Oct 19 18:35:27 2017 +0100 Minor cleanup to previous commit regarding visit-implicit-code CCBUG: 385851 commit 4847a25f3fa65744bd7dd23533da6bb8783ca6b6 Author: Richard Oehlinger <r.oehlinger@avibit.com> Date: Thu Oct 19 16:00:29 2017 +0200 Add option to visit implicit code, such as compiler generated CTORs Although clazy's built-in checks don't need this, some custom user checks might Not enabled by default as it causes a slight slowdown BUG: 385851 |
Created attachment 108400 [details] Minimal patch Right now its not possible to check for actions performed in an implicit constructor. Therfore ClazyASTConsumer should override the method shouldVisitImplicitCode. See patch attached. Perhaps this should be configurable, but I don't know how to incorporate this best.