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 auto in function template triggers false-positive error #2478

Closed
taylorgordon20 opened this issue Sep 1, 2018 · 2 comments
Closed

Comments

@taylorgordon20
Copy link

taylorgordon20 commented Sep 1, 2018

struct Foo {
  template <auto x>
  void foo() {}
};

void bar() {
}

Foo f;
f.foo<bar>();

Results in "f" being underlined with an error squiggle and the message:

no instance of function template "Foo::foo" matches the argument list -- object type is: Foo

@bobbrow bobbrow added Language Service investigate This issue needs to be investigated/confirmed parser labels Sep 4, 2018
@sean-mcmanus sean-mcmanus added external and removed investigate This issue needs to be investigated/confirmed labels Sep 4, 2018
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Sep 4, 2018

Thanks for reporting this. It repros with VS 2017, so I've reported it there: https://developercommunity.visualstudio.com/content/problem/327851/c17-auto-in-function-template-triggers-false-posit.html .

UPDATE: The fix will be in our next Insiders release (0.21.0-insiders), probably next week.

@sean-mcmanus
Copy link
Collaborator

Should be fixed with 0.21.0-insiders (auto installed if "C_Cpp.updateChannel": "Insiders" is set, or the offline vsix). Let us know if you find any problems with it.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants