Project: %h -x c++-header

Fangrui Song 2019-01-15 23:24:29 +08:00
parent 8a532fd7ba
commit 74bd3e3de5

@ -162,6 +162,11 @@ Objective-C (`%objective-c`), or Objective-C++ (`%objective-c++`) files.
This argument should be added only when indexing C header files (`%h`: `*.h`) or C++
header files (`%hpp`: `*.hh` `*.hpp`). Note, `*.h` files are considered as C, not C++.
You may add a line `%h -x c++-header` to make every `*.h` parsed as C++.
Note, if your project has both C and C++ files, `a.h`'s flags may be inferred from a C file and thus parsed as C.
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`.