vim 中的 clang_complete 是否需要代码通过 clang 编译才能工作?

Does clang_complete in vim requiers the code to pass clang compilation in order to work?

我正在使用 neovim 作为编辑器,并尝试为使用 gcc 作为编译器的 c/c++ 代码启用自动完成功能。

我的问题是 clang_complete 对 clang/llvm 的依赖是否意味着代码应该能够在 clang 下编译。

我问的原因是因为我怀疑我的代码库不能用 clang 编译(由于使用 gcc 扩展)并且因为自动完成只能部分工作(建议使用一些功能,有些不建议使用)

My question is whether the dependency of clang_complete on clang/llvm means that the code should be able to compile under clang.

没错。但是,clang 实现了 GCC 的一些扩展,因此可能会起作用。完成可能无法正常工作还有其他原因,例如缺少编译器标志或找不到包含。我建议尝试一个应该在任何编译器中工作的源文件(比如完成 std::vector,等等)。