llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.95k stars 11.53k forks source link

[clang-tidy] Clang-tidy incorrectly selects the first available record in compilation_database.json without warning #59171

Open KindDragon opened 1 year ago

KindDragon commented 1 year ago

Our GN produce compilation_database.json with several records for same C++ files when we compile it for several toolset, but clang-tidy always silently use first entry.

My suggestion to report error and exit when compilation_database.json contain several records for file and maybe add special argument that restore old behaviour.

For example, we can compile same file for these toolsets:

llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-tidy