0

In an experiment with QtCreator 9.01 (windows 10), I encounter a bug when I unleash clang-tidy with the "performance-unnecessary-value-param"-check on a larger C++ code base ( > 700 files). It finds about 300 cases and I want to fix all at once, so I choose "Select Fixits" and then apply correction. This seems to work, but after running the fixits, some function declarations (very few not many) in header files actually break.

Here are some (obfuscated) examples:

enter image description here

I think it must have something to do with how all the fixits of all the files are executed together at once. Can there be any race condition here? The strange thing is that if I manually select the file where the above 3 problems occurred and then apply clang tidy only to that one, it all gets fixed completely correctly!

I can't give a minimal example, unfortunately, because this only occurs with a large codebase with hundreds of files in my scenario. But I think it is a problem of qtcreator or of clang-tidy, because I did the same experiment with Clion and clang-tidy (clang-tidy version was 16.0.0!) and here everything was replaced correctly and also at once. What I also noticed was that the fixits in clion took much longer (so maybe serialized?) than in qtcreator which took only about 2 seconds to execute all fixits of all files.

Can anyone confirm that this check is broken or that there is a problem in the QTCreator? This is a more critical problem, I think, because the fixits need to be reliable, especially in large applications where it is tedious to recheck everything.

Additional infos:
Onboard clang-tidy version of qtcreator 9.01:

./clang-tidy.exe --version LLVM (http://llvm.org/): LLVM version 15.0.0 Optimized build. Default target: x86_64-w64-windows-gnu Host CPU: skylake

SoulfreezerXP
  • 459
  • 1
  • 5
  • 19

0 Answers0