Type: LanguageService
- OS and Version: Linux Mint 64-bit
- VS Code Version: 1.24.0
- C/C++ Extension Version: 0.17.4
Intellisense interprets the construct auto p{"Fred"} as deduction of an initializer list. In C++17 that should not be the case.
To Reproduce
Use the following C++17 main.cpp file:
int main()
{
auto s = "fred";
auto p{s};
}
along with the following (auto-generated) c_cpp_properties.json file:
{
"configurations": [
{
"name": "Linux",
"browse": {
"path": [
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"${workspaceFolder}"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
Red squiggles appear under auto p. Intellisense is seeing this line as a deduction of an initializer list.
Expected behavior
auto p{s} should be recognized as p being a const char *.
Type: LanguageService
Intellisense interprets the construct
auto p{"Fred"}as deduction of an initializer list. In C++17 that should not be the case.To Reproduce
Use the following C++17
main.cppfile:along with the following (auto-generated)
c_cpp_properties.jsonfile:{ "configurations": [ { "name": "Linux", "browse": { "path": [ "${workspaceFolder}" ], "limitSymbolsToIncludedHeaders": true }, "includePath": [ "${workspaceFolder}" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "clang-x64" } ], "version": 4 }Red squiggles appear under
auto p. Intellisense is seeing this line as a deduction of an initializer list.Expected behavior
auto p{s}should be recognized aspbeing aconst char *.