[clangd] Support `-stdlib` flags in SystemIncludeExtractor. (#69283)
The `--stdlib` flag can affect the system headers used by `clang` during
compilation. By default, `clang` will use the platform-installed C++
standard headers, but with `--stdlib=libc++`, `clang` can use headers
included in the distribution for its `libc++` implementation.
Prior to this patch, if `compile_commands.json` specified
`-stdlib=libc++` or an equivalent form and `--query-driver` took effect,
`clangd` would ignore `stdlib` and index based on the platform's
headers. When these mismatch, e.g. due to version differences,
`clangd`'s completions and the actual compilation can differ.
fixes clangd/clangd#1784
---------
Co-authored-by:
Chris Carlon <cjc25@cjc25.com>
parent
2f3d4f6c
Please register or sign in to comment