mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
Project-Setup: clarify compiler driver clang++
parent
33c868c021
commit
d6d6d0b280
@ -182,10 +182,13 @@ You may run into parsing errors like `unknown type name 'class'`.
|
||||
|
||||
### Compiler driver
|
||||
|
||||
The compiler driver (the first line unless `%compile_commands.json` is used) can usually just be `clang`.
|
||||
`clang++` is usually unnecessary, and incorrect if some files are C.
|
||||
Just use `clang` as the compiler driver (the first line unless `%compile_commands.json` is used).
|
||||
|
||||
Note that `clang a.cc` and `clang++ a.cc` are different, but the difference is only related to linking (what default runtime libraries are passed) and is not relevant for the frontend actions ccls performs.
|
||||
* `clang` defaults to GCCMode (gcc). It correctly treats `.c` files as C and `.cpp` files as C++.
|
||||
* `clang++` defaults to GXXMode (g++). It treats a `.c` file as C++ and issues a warning.
|
||||
|
||||
`clang a.cc` and `clang++ a.cc` are different, but the difference is only related to linking (what default runtime libraries are passed) and is not relevant for the frontend actions ccls performs.
|
||||
So for ccls use cases, just stick with `clang`.
|
||||
|
||||
## `.ccls` examples
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user