how to add c++11 support to syntastic vim plugin?

前端 未结 5 752
抹茶落季
抹茶落季 2020-12-23 02:18

I am using syntastic in my c++11 project. When I am editing in vim, and save (:w) the syntastic plugin gives me errors on every initializer list {} and for each loops which

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-23 02:27

    If you use YouCompleteMe,maybe you should change '.ycm_extra_conf.py'.only change flags:(file path~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py) ;

     flags = [
     '-std=c++11',
     '-O0',  
     '-Werror', 
     '-Weverything', 
     '-Wno-documentation', 
     '-Wno-deprecated-declarations', 
     '-Wno-disabled-macro-expansion', 
     '-Wno-float-equal', 
     '-Wno-c++98-compat', 
     '-Wno-c++98-compat-pedantic', 
     '-Wno-global-constructors', 
     '-Wno-exit-time-destructors', 
     '-Wno-missing-prototypes', 
     '-Wno-padded', 
     '-Wno-old-style-cast',
     '-Wno-weak-vtables',
     '-x', 
     'c++', 
     '-I', 
     '.', 
     '-isystem', 
     '/usr/include/',
     ]
    

提交回复
热议问题