Type: LanguageService
Thanks very much for all your work on this extension. I really love using both it and VSCode.
Strict Intellisense on this source code:
struct x {
constexpr x(int val) {
[[maybe_unused]] const auto mu = __builtin_expect( val, 0 );
}
};
[[maybe_unused]] constexpr x x1{ 3 };
…puts a red-squiggle under the x1 on the last line, with mouseover message:
expression must have a constant value -- cannot call non-constexpr function "__builtin_expect" (declared implicitly)
constexpr x x1
…but GCC and Clang are happy with it:
g++ -Werror -Wall -Wextra -pedantic -std=c++17 -fsyntax-only a.cpp
clang++ -Werror -Wall -Wextra -pedantic -std=c++17 -fsyntax-only a.cpp
I've come across this through using the Microsoft GSL library. I can work-around the issue by adding a GSL_UNENFORCED_ON_CONTRACT_VIOLATION define in c_cpp_properties.json. But it'd be good to get this fixed in VSCode.
Repro steps:
- Open a folder
- Create and open
a.cpp
- Paste in the above code
- Set strict Intellisense - full
c_cpp_properties.json as follows…
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
Context:
C/C++ for Visual Studio Code v0.20.1
Version: 1.29.0
Commit: 5f24c93878bd4bc645a4a17c620e2487b11005f9
Date: 2018-11-12T07:42:27.562Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
Ubuntu 18.04.1 LTS
Linux 4.15.0-39-generic #42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 2018
Thanks again.
Type: LanguageService
Thanks very much for all your work on this extension. I really love using both it and VSCode.
Strict Intellisense on this source code:
…puts a red-squiggle under the
x1on the last line, with mouseover message:…but GCC and Clang are happy with it:
I've come across this through using the Microsoft GSL library. I can work-around the issue by adding a
GSL_UNENFORCED_ON_CONTRACT_VIOLATIONdefine inc_cpp_properties.json. But it'd be good to get this fixed in VSCode.Repro steps:
a.cppc_cpp_properties.jsonas follows…{ "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**" ], "defines": [], "compilerPath": "/usr/bin/clang", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "clang-x64" } ], "version": 4 }Context:
Thanks again.