Browse Source

Fixed llvm 15 crash when trying to parse C header as C++ header in a C project

merge-requests/413/head
eidheim 3 years ago
parent
commit
2fe8f1cb46
  1. 2
      src/compile_commands.cpp

2
src/compile_commands.cpp

@ -232,7 +232,7 @@ std::vector<std::string> CompileCommands::get_arguments(const boost::filesystem:
arguments.emplace_back("-finclude-default-header"); arguments.emplace_back("-finclude-default-header");
arguments.emplace_back("-Wno-gcc-compat"); arguments.emplace_back("-Wno-gcc-compat");
} }
else if(is_header) else if(is_header && extension != ".h") // libclang crashes if it tries to parse .h files as C++ file in a C project
arguments.emplace_back("-xc++"); arguments.emplace_back("-xc++");
if(!build_path.empty()) { if(!build_path.empty()) {

Loading…
Cancel
Save