What | Removed | Added |
---|---|---|
Status | NEW | RESOLVED |
Resolution | --- | INVALID |
(In reply to Andreas Nordal from comment #0) > /tmp/compile_commands.json: > > [{ > "directory": "/tmp", > "command": "g++ -std=c++17 -Iweird_include -c takes_string_view.cpp -o > takes_string_view.o", > "file": "takes_string_view.o" > }] The "file" needs to be "takes_string_view.cpp" [1]: > file: The main translation unit source processed by this compilation step. > This is used by tools as the key into the compilation database. There can be > multiple command objects for the same file, for example if the same source > file is compiled with different configurations. Then -std=c++17 is passed through. Possibly clangd thinks that since takes_string_view.o does not have a C++ source file ending, an option like -std=c++17 has to be dropped. (Clang can also process other files, such as assembly .s, LLVM IR .ll/.bc and some more.) [1] https://clang.llvm.org/docs/JSONCompilationDatabase.html#format