Configure clang-check for c++ standard libraries

后端 未结 2 734
臣服心动
臣服心动 2021-01-15 03:49

I am trying to run Ale as my linter, which in turn uses clang-check to lint my code.

$ clang-check FeatureManager.h
Error while trying to load a compilation         


        
2条回答
  •  长情又很酷
    2021-01-15 04:31

    Took a while to figure this out, but you can do

    clang-check file.cxx -- -Wall -std=c++11 -x c++

    or if you are using clang-tidy

    clang-tidy file.cxx -- -Wall -std=c++11 -x c++

    To get both working with ALE, I added the following to my vimrc

    let g:ale_cpp_clangtidy_options = '-Wall -std=c++11 -x c++' let g:ale_cpp_clangcheck_options = '-- -Wall -std=c++11 -x c++'

    If you want ALE to work for C as well, you will have to do the same for g:ale_c_clangtidy_options and g:ale_c_clangcheck_options.

提交回复
热议问题