[clang-tools-extra] [clangd] fix asserts on incompatible paths in CDB (PR #148019)

Dmitrii Sharshakov via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 10 11:04:03 PDT 2025


dsseng wrote:

> I do think it would be good to have a test case for this; this is tricky code (and probably also performance-sensitive), and walking through a test case helps to think through the resulting behaviour.
> 
> You can have a look at [this test case](https://searchfox.org/llvm/rev/b16fe132c68834a601b29c0eb53c7ec25a3cd627/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp#312) as an example of a test for this class, which sets up a compilation database using the contents of `compile_commands.json` as input, and triggers operatins like `getCompileCommand()` on it.

I could not get the affected code to run and crash via a similar test so far. Sorry, I might need more time or assistance on this

https://github.com/llvm/llvm-project/pull/148019


More information about the cfe-commits mailing list