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
I tried to work around this by adding parentheses.
It simply lowers forward without std::.
I suppose it's due to commit c39a94c (#77). (forward (r$)); lowers to return forward(_0); (https://cpp2.godbolt.org/z/YTP8vd61K).
Expected result
Diagnostic, probably disallowing forward with capture
This could work with std::forward_like<decltype(this)> semantics (given 4bd0c04#commitcomment-133309652): :(forward this) (forward c$).
Describe the bug
Enclosing capture in
forward
crashes compilerReproduction Code
https://cpp2.godbolt.org/z/E4rqKW4cn
Version
latest (38aec57)
Command lines
cppfront/cppfront $1.cpp2 -p
clang++-15 -Icppfront/include $1.cpp -std=c++20 -o $1
Expected result
Diagnostic, probably disallowing forward with capture
Actual result
cppfront: source/cppfront.cpp:2712: void cpp2::cppfront::emit(cpp2::postfix_expression_node &, bool): Assertion `!current_args.back().ptoken' failed.
Aborted (core dumped)
Additional context
Assert line is https://github.com/hsutter/cppfront/blob/main/source/cppfront.cpp#L2712
This example shows
forward
can be written at call site.cppfront/regression-tests/mixed-forwarding.cpp2
Line 21 in 38aec57
Don't know if forward with capture makes sense.
The text was updated successfully, but these errors were encountered: