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

Structure binding a tuple-like type #131

Closed
shebdim opened this issue Mar 1, 2019 · 1 comment
Closed

Structure binding a tuple-like type #131

shebdim opened this issue Mar 1, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@shebdim
Copy link

shebdim commented Mar 1, 2019

#include <tuple>

std::tuple<int, float> foo();
 
auto [a, b] = foo();

transform into invalid syntax

#include <tuple>

std::tuple<int, float> foo();

 
std::tuple<int, float> __foo5 = foo();
std::tuple_element<0, std::tuple<int, float> >::type& a = std::get<0ul>(__foo5);
std::tuple_element<0, std::tuple<float> >::type& b = std::get<std::tuple_element<0, std::tuple<int, float> >::type && a = std::get<0ul>();
ulstd::tuple_element<0, std::tuple<float> >::type && b = std::get<1ul>();
(__foo5);
@andreasfertig
Copy link
Owner

Hello @shebdim,

thanks for reporting that! You found a special case with the function call and the global decomposition. A fix is on its way.

Andreas

andreasfertig added a commit that referenced this issue Mar 1, 2019
Fixed #131: Global DecompositionDecl transformation was wrong.
@andreasfertig andreasfertig added the bug Something isn't working label Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants