-
-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The following code:
#include <utility>
int main()
{
std::pair<int, char> p;
auto [a, b] = p;
}Produces this after being run in cppinsights:
#include <utility>
int main()
{
std::pair<int, char> p = std::pair<int, char>();
std::pair<int, char> __p6 = std::pair<int, char>(p);
int a = std::get<0UL>(static_cast<std::pair<int, char> &&>(__p6));
char b = std::get<1UL>(static_cast<std::pair<int, char> &&>(__p6));
}I think that is incorrect. It should be:
Produces this after being run in cppinsights:
#include <utility>
int main()
{
std::pair<int, char> p = std::pair<int, char>();
std::pair<int, char> __p6 = std::pair<int, char>(p);
int& a = std::get<0UL>(static_cast<std::pair<int, char> &&>(__p6));
char& b = std::get<1UL>(static_cast<std::pair<int, char> &&>(__p6));
}According to cppreference:
For each identifier, a variable whose type is "reference to std::tuple_element<i, E>::type" is introduced: [...]
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working