Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++17 template argument deduction and structured binding type deduction #2101

Closed
narutse opened this issue Jun 8, 2018 · 3 comments
Closed
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service parser
Milestone

Comments

@narutse
Copy link

narutse commented Jun 8, 2018

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:
template argument
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:
structured binding
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.

  • OS and Version: Manjaro Linux
  • VS Code Version: 1.24.0
  • C/C++ Extension Version: 0.17.4
@sean-mcmanus
Copy link
Collaborator

Thanks for reporting this. I'm able to repro the problems.

@sean-mcmanus sean-mcmanus added this to the 0.17.7 milestone Jul 12, 2018
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Jul 12, 2018
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Jul 12, 2018

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: #2256 .

@sean-mcmanus
Copy link
Collaborator

@narutse The int& got resolved as "by design" -- see #2256 and https://developercommunity.visualstudio.com/content/problem/229224/intellisense-displays-wrong-type-for-structed-bind.html .

@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service parser
Projects
None yet
Development

No branches or pull requests

2 participants