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

test: avoid unnamed parameter in function type template argument #1291

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JohelEGP
Copy link
Contributor

@JohelEGP JohelEGP commented Oct 1, 2024

Resolves 212eb15#commitcomment-147400224
by avoiding the unnamed parameters,
rather than changing the lowering to Cpp1.

pure2-last-use.cpp2:279:272: error: no member named 'move_only_function' in namespace 'std'
requires (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> in_)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> in_)>>&>)
requires (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> inx)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> inx)>>&>)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be one of the lowering bugs mentioned at 212eb15#commitcomment-147040717.

2137 | return false;
| ^
2137 | template<typename T, specialization_of_template<std::optional> X>
| ^~~~~~~
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some GCC 10 version doesn't output these ~ squiggles.
Maybe @hsutter's local version or a CI runner's.
In the main branch's commit c5feb42,
they are again removed: c5feb42#diff-aa97a613d9dea020a78ec4046393f329f881475e3d67f8796e6e8afec5849968R4.

@JohelEGP JohelEGP mentioned this pull request Oct 7, 2024
@hsutter
Copy link
Owner

hsutter commented Oct 31, 2024

Thanks! There are merge conflicts so I won't try to merge this for 0.8. As described in #1322, that means I need a new one-time CLA that will cover all your future contributions. I've emailed you the new CLA, and one it's completed I can look at this PR.

@@ -1,12 +1,21 @@
pure2-last-use.cpp2:273:36: error: expected variable name or 'this' in lambda capture list
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Regressions weren't re-run so I did that and committed the results.

Note these Clang-12 results in particular changed, can you check the diffs and see if they're benign?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the change looks right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants