Unverified Commit 3935a29a authored by Chris Carlon's avatar Chris Carlon Committed by GitHub
Browse files

[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: default avatarChris Carlon <cjc25@cjc25.com>
parent 2f3d4f6c
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment