Type: LanguageService
I encountered two intellisense issues that seem to be in conflict with the C++17 standards:
The first one is that the C++ extension considers class template argument deduction an error (http://en.cppreference.com/w/cpp/language/class_template_argument_deduction) with red squiggles. Below is the screenshot:
This code compiles in major compilers with c++17 standards. I'm pretty sure I have the c++17 standard on for intellisense, as it is on by default in the cpp properties file, and structured bindings work.
The second issue is the type deduction in the auto [..., ...] structured bindings. Below is the screenshot:
Variable a here should be of type int instead of int&. I checked with gcc and clang by tricking them to print out the type through template compiler errors.
Thanks for reporting this. I'm able to repro the problems.
The bogus error will be fixed in our pending 0.17.7-Insiders update, but the "int &" bug still repros (even with VS 2017), so I created a new bug for that: https://github.com/Microsoft/vscode-cpptools/issues/2256 .
@narutse The int& got resolved as "by design" -- see https://github.com/Microsoft/vscode-cpptools/issues/2256 and https://developercommunity.visualstudio.com/content/problem/229224/intellisense-displays-wrong-type-for-structed-bind.html .
Most helpful comment
Thanks for reporting this. I'm able to repro the problems.