Type: LanguageService
c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.17134.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64",
"compileCommands": "${workspaceFolder}/build/release/compile_commands.json"
}
],
"version": 4
}
Describe the bug
To Reproduce
have a c++ file with this code and above c_cpp_properties.json:
#pragma once
#ifdef __cplusplus
#if __cplusplus < 201402L
#error "C++14 or higher is required"
#endif
#endif
The plugin reports an error that C++14 or higher is required
Issue #2248 and https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/ have some more background on this issue.
Short story is that this was actually the expected behavior until earlier this year when /Zc:__cplusplus support was added to cl.exe. I think it was a mistake to close #2248 and we should use this issue to track adding support for this in IntelliSense.
Support for /Zc:__cplusplus in compilerArgs was added with https://github.com/microsoft/vscode-cpptools/releases/tag/0.30.0-insiders4 .
Most helpful comment
Issue #2248 and https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/ have some more background on this issue.
Short story is that this was actually the expected behavior until earlier this year when
/Zc:__cplusplussupport was added to cl.exe. I think it was a mistake to close #2248 and we should use this issue to track adding support for this in IntelliSense.