-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[Clang] [Modules] Importing a function returning a transform view containing a lambda causes problems. #116087
Comments
@llvm/issue-subscribers-clang-modules Author: None (Sirraide)
Consider (https://godbolt.org/z/97rdzMq58):
```c++
// a.ccm
module;
#include <ranges>
#include <vector>
export module A;
export std::vector<int> vec; // b.ccm // Identical to 'bar()' above. void foo() {
We seem to be failing to... construct a lambda that has no captures, which is weird. Considering that the problem also goes away if I pass e.g. I might look into that later today or tomorrow if I can find the time. CC @ChuanqiXu9 |
@llvm/issue-subscribers-clang-frontend Author: None (Sirraide)
Consider (https://godbolt.org/z/97rdzMq58):
```c++
// a.ccm
module;
#include <ranges>
#include <vector>
export module A;
export std::vector<int> vec; // b.ccm // Identical to 'bar()' above. void foo() {
We seem to be failing to... construct a lambda that has no captures, which is weird. Considering that the problem also goes away if I pass e.g. I might look into that later today or tomorrow if I can find the time. CC @ChuanqiXu9 |
Not sure if this is related to #110146 Maybe you can verify this by modifying the standard library by adding an |
And BTW, we suggest to use |
I’d love to do that, but I don’t think libstdc++ supports that yet, right? |
Yeah, but if you'd like to, it is pretty easy to mock one: https://github.com/alibaba/async_simple/blob/main/async_simple/std.mock.cppm |
Consider (https://godbolt.org/z/97rdzMq58):
In
foo()
in moduleB
, we callbar()
, which is imported from moduleA
and returns a transform view that is passed a lambda. Attempting to pipe that to another transform view fails, even though it works just fine if we define the function in the same module asfoo
We seem to be failing to... construct a lambda that has no captures, which is weird. Considering that the problem also goes away if I pass e.g.
std::identity{}
totransform
inbar()
, this feels like it’s just #110401 all over again, but this time we’re failing to find the right constructor.I might look into that later today or tomorrow if I can find the time.
CC @ChuanqiXu9
The text was updated successfully, but these errors were encountered: