3

I tried this solution using instead of C++11 C++14, but it doesn't work, I still get for this line:

auto number(0);

that:

'auto' type specifier is incompatible with C++98

with syntastic.

Why is syntastic still using C++98 and not C++14?

  • Which version of clang do you have? According to this page you need at least version 3.4 for -std=c++14 to work. For earlier versions, you need to use -std=c++1y (invalid values for -std seem to be ignored). – Martin Tournoij May 7 '15 at 16:39
  • Do you also have YCM installed? – lcd047 May 7 '15 at 17:13
  • I have clang 3.6 installed, thus it should work :·) – tuxtoriel May 7 '15 at 17:23
  • Yes, I have YCM installed. Are there any incompatibilities with it? – tuxtoriel May 7 '15 at 17:24
  • Because YCM disables syntastic checks by default. With recent versions of syntastic the :SyntasticInfo command will tell you that (provided that you run in against a C++ file). – lcd047 May 7 '15 at 17:26
3

In my .vimrc, I have:

let g:syntastic_cpp_checkers = ['gcc']
let g:syntastic_cpp_compiler = 'gcc'
let g:syntastic_cpp_compiler_options = '-std=c++14'

And, if you have YCM enabled:

let g:ycm_show_diagnostics_ui = 0

And now it works!

| improve this answer | |
  • 1
    Note that you're using gcc now, and not clang (clang has much better errors). – Martin Tournoij May 7 '15 at 19:37
  • @Carpetsmoker: He's actually using clang-check, which is essentially the same as clang's parser. On a side note, clang-tidy is interesting too. – lcd047 May 7 '15 at 19:45
  • I am really sorry but I have to change my answer, because, as I came back to Vim and typed in something that would cause an error, I realized that actually, syntastic does NOT CORRECT AT ALL! Thats why it did not give anything about 'auto'. I know that it is only bypassing this problem, but by using gcc as syntastic checker and compiler, it works just fine! (really, this time!). – tuxtoriel May 7 '15 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.