mitaki28 / vscode-clang

Completion and Diagnostic for C/C++/Objective-C using Clang
MIT License
128 stars 24 forks source link

False positive of error: "c++17 invalid value in --std=c++17" #63

Closed Archivist062 closed 6 years ago

Archivist062 commented 6 years ago

Step to reproduce:

  1. In a c++ project
  2. add the following in Workspace settings
    {
    "clang.cxxflags": [
        "--std=c++17"
    ]
    }
  3. open an editor in a valid C++ file

VSCODE:

Extension

clang -v:

clang version 3.8.1-24 (tags/RELEASE_381/final)
Target: i686-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/5.4.1
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/6.3.0
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/7.2.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.1
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.3.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/7.2.0
Selected GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/7.2.0
Candidate multilib: .;@m32
Candidate multilib: 64;@m64
Candidate multilib: x32;@mx32
Selected multilib: .;@m32

OS:

Debian 9 32bit

jonasdmentia commented 6 years ago

That error isn't a false positive, it's correct. clang's c++17 support began with 5.0, so 3.8 doesn't recognize --std=c+17. It does have some pre-standard support which you can enable with --std=c++1z.

For details see here.

davydden commented 6 years ago

@jonasdmentia a bit off-topic, but the Contributions tab of vscode-clangd does not list clang.cxxflags as an option. Has something changed recently?

jonasdmentia commented 6 years ago

@davydden, not according to the commit history...if anything it looks a bit dead as it's not been touched in a year. That said, my Contributions tab still lists clang.cxxflags. I'm running vscode 1.21.1 with vscode-clangd 0.2.2

davydden commented 6 years ago

ah, sorry, I mixed this GitHub repository vscode-clang with LLVM's plugin vscode-clagd https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd with version 0.0.5.