From 74bd3e3de568263c654c9e41d2ec50deba796a18 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 15 Jan 2019 23:24:29 +0800 Subject: [PATCH] Project: %h -x c++-header --- Project-Setup.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Project-Setup.md b/Project-Setup.md index 33239c9..997f52c 100644 --- a/Project-Setup.md +++ b/Project-Setup.md @@ -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`.