-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--query-driver
does not work with fallback flags for .h
file if driver is gcc and objective-c++ support is not installed
#1568
Comments
I should add that the issue also arises in cases where the project itself has a |
I installed Maybe it's safe to just unconditionally downgrade |
Linking to proposed fix for this: https://reviews.llvm.org/D147905 |
Fixed on trunk, which is now targeting clangd 18. It would be nice to have the fix in clangd 17 as well (too late for clangd 16); I will request a cherry-pick. |
…xtractor Fixes clangd/clangd#1568 Differential Revision: https://reviews.llvm.org/D147905 (cherry picked from commit bd74186)
…xtractor Fixes clangd/clangd#1568 Differential Revision: https://reviews.llvm.org/D147905 (cherry picked from commit bd74186)
…xtractor Fixes clangd/clangd#1568 Differential Revision: https://reviews.llvm.org/D147905
…xtractor Fixes clangd/clangd#1568 Differential Revision: https://reviews.llvm.org/D147905
…xtractor Fixes clangd/clangd#1568 Differential Revision: https://reviews.llvm.org/D147905
…xtractor Fixes clangd/clangd#1568 Differential Revision: https://reviews.llvm.org/D147905
…xtractor Fixes clangd/clangd#1568 Differential Revision: https://reviews.llvm.org/D147905
…xtractor Fixes clangd/clangd#1568 Differential Revision: https://reviews.llvm.org/D147905
…xtractor Fixes clangd/clangd#1568 Differential Revision: https://reviews.llvm.org/D147905
One of the main use cases of the
Compiler:
config option is to allow specifying the compiler to query for built-in include paths in projects that don't have acompile_commands.json
file.While the
Compiler:
config option itself was added in clangd 14, this use case was broken until clangd 16 due to #1089 (the edit to the compile command to replace argv[0] withCompiler:
was performed after the system include extractor had already run).Today, I discovered that this use case is still partially broken even in clangd 16.
If the project has no
compile_commands.json
file, the initial compile command is the fallback command returned byGlobalCompilationDatabase::getFallbackCommand()
. If the file being opened is a.h
file, the fallback command contains-xobjective-c++-header
, since we don't know the language of the header and objective-c++ is the most permissive of the supported languages. This-x
flag is preserved in the command used to extract system includes from the driver.If the driver is a gcc, we run into an unfortunate snag: gcc's objective-c++ support is often contained in a separate package, e.g.
gobjc++
, which is not necessarily installed if the user isn't actually writing objective-c++. In such cases, the system include extraction command fails with:The text was updated successfully, but these errors were encountered: