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

"int &" type incorrectly reported instead of "int" for deduced auto variable #2256

Closed
sean-mcmanus opened this issue Jul 12, 2018 · 2 comments

Comments

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Jul 12, 2018

#include
#include
using namespace std;

int main()
{
pair<int, int> p { 1, 2 };
auto[a, b] = p; // hover over a shows “int &a” instead of “int a”
a = 10;
cout << p.first << a << endl;
return 0;
}

The bug repros with VS 2017 too. I'll link to the VS-side bug if/when it gets created.

The previous issue was #2101 .

@sean-mcmanus
Copy link
Collaborator Author

@rpjohnst
Copy link

This is not a bug; the standard specifies this behavior in paragraph [dcl.struct.bind]/3.

@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

2 participants