Search code examples
vimneovimclang-complete

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


I'm using neovim as editor and am trying to enable auto-completion for c/c++ code which uses gcc as its compiler.

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

The reason I'm asking is because I suspect my code base does not compile with clang (due to use of gcc extensions) and since auto-completion only partially works (some functions are suggested, some don't)


Solution

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

    That's correct. However, clang implements some extensions of GCC and thus might work. There are other reasons why completion might not work, like missing compiler flags or failure to find includes. I'd suggest to try on a source file that should work in any compiler (like completing std::vector, etc.).