You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Return-by broken by "return expression list" support #408
changed the title [-][BUG] Return-by broken by ab29f19d84985594569d27e11db8190bb54bf019[/-][+][BUG] Return-by broken by "return expression list" support[/+]on May 3, 2023
This change would also make it so that
parentheses are required around a passed-by binary expression.
That's a plus, as a conventional binary expression should require no pass-by.
E.g., f(move a + b); -> f(move (a + b));.
Thanks! Got here from #487 -- for now I think the right fix is to not emit {} on deduced returns, which can change the type. We still want the {} on non-deduced returns I think. Anyway, the coming commit should fix this problem, and if there's more we can look at it again with new examples.
Activity
[-][BUG] Return-by broken by ab29f19d84985594569d27e11db8190bb54bf019[/-][+][BUG] Return-by broken by "return expression list" support[/+]JohelEGP commentedon May 3, 2023
JohelEGP commentedon May 3, 2023
I think that'd make the parameter-directions in expression-list redundant.
This change would also make it so that
parentheses are required around a passed-by binary expression.
That's a plus, as a conventional binary expression should require no pass-by.
E.g.,
f(move a + b);->f(move (a + b));.This is probably necessary, anyways.
EDIT: Rereading #77 (comment),
forwardalready works like a prefix operator: https://cpp2.godbolt.org/z/a1eeMvWhK.JohelEGP commentedon May 3, 2023
I just noticed this, to replace #408 (comment).
JohelEGP commentedon May 22, 2023
An alternative to the general solution above:
But the general solution is more useful.
There are more unparenthesized arguments in Cpp1 and Cpp2, like in
a = b.hsutter commentedon Aug 10, 2023
Thanks! Got here from #487 -- for now I think the right fix is to not emit
{}on deduced returns, which can change the type. We still want the{}on non-deduced returns I think. Anyway, the coming commit should fix this problem, and if there's more we can look at it again with new examples.Don't emit `{` `}` around a single-anon-type deduced return, fixes hs…
Don't emit `{` `}` around a single-anon-type deduced return, fixes hs…