[llvm-dev] clang-tidy: fixing member vars across files

Oleg Smolsky via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 2 16:16:27 PST 2021


...and the answer to both questions is the `-header-filter` option. It
looks like there are no implicit defaults and so if you are checking code
in `./libs/mylib/`, that must be expressed with the aforementioned option.

Hopefully this note will be useful to someone.

On Thu, Dec 2, 2021 at 3:40 PM Oleg Smolsky <osmolsky at netskope.com> wrote:

> Folks, I've just realized that while the modernize-use-default-member-init
> check works for cases where all code (the class declaration, the
> constructor declaration and definition) is located in one file. That is a
> minor case in our code base as the absolute majority of code is split
> between the .h/.cpp files.
>
> 1) Is there something magical that I need to do in order to get
> `clang-tidy` refactoring working for that "splic code" case? I have the
> `compile_commands.json` file and checks seem to be working... but this
> particular check does not.
>
> 2) How do I repro the with the LIT tests? Today they just check a single
> file... can I jam a #include there?
>
> Thanks!
> Oleg.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211202/96a97956/attachment.html>


More information about the llvm-dev mailing list