[all-commits] [llvm/llvm-project] 3935a2: [clangd] Support `-stdlib` flags in SystemIncludeE...

Chris Carlon via All-commits all-commits at lists.llvm.org
Tue Oct 24 14:33:14 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3935a29a3e8acf31bb1658265e8f9b977435f6bb
      https://github.com/llvm/llvm-project/commit/3935a29a3e8acf31bb1658265e8f9b977435f6bb
  Author: Chris Carlon <chris.carlon25 at gmail.com>
  Date:   2023-10-24 (Tue, 24 Oct 2023)

  Changed paths:
    M clang-tools-extra/clangd/SystemIncludeExtractor.cpp
    M clang-tools-extra/clangd/test/system-include-extractor.test

  Log Message:
  -----------
  [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 at cjc25.com>




More information about the All-commits mailing list