-
Notifications
You must be signed in to change notification settings - Fork 161
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
subobject-linkage error with GCC #1143
Comments
I think this is https://stackoverflow.com/questions/55881676/werror-subobject-linkage-for-lambda-as-a-template-parameter-in-header-what-i. It's unclear to me if this is a gcc bug, or if I'm legitimately doing something wrong by using anonymous types / lambdas as template parameters. I don't think there is much I can do about it, though. If I'm not mistaken, -Wsubobject-linkage is a warning. You're probably seeing it as an error because you are also specifying -Werror, is that right? If so, would you be willing to exclude this warning? UPDATE: possibly relevant: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111423 |
Thanks for investigating, @ericniebler I managed to work around it by changing from co_awaits/tasks to senders here. So it isn't pressing right now. static auto sleep_for(context& ctx, event_t::time_resolution time)
{
// Run the delay sender and then switch back to the worker thread.
// The delay completion happens from the sd-event handler, which is
// ran on the 'caller' thread.
return execution::transfer(sleep_sender(ctx, time), get_scheduler(ctx));
} I'm surprised I'm not currently seeing this in any other code using tasks though.
Correct. I'm writing a library though so I can't totally control what consumers end up compiling/linking with. Most of the projects in our organization use Meson's |
Let me add some info here since this is one of the first relevant links while searching for this bug. code like This is a gcc bug and has been fixed in gcc 14 bugzilla. While this is indeed generates a warning, compilers produce the wrong linkage type for these types and thus failing during linkage, while clang works correctly and gcc will be released at some point, this bug appears to be present in msvc. P.S. @ericniebler you have extra |
This could very well be something wrong with my code. Using the latest stdexec, I'm started seeing this subobject-linkage warning in GCC. It isn't obvious which type is even being called out as a problem.
The affected code is a rather simple co-routine using the stdexec task.
Both
co_awaits
have this subobject-linkage problem, so even if I comment out the first one I still end up with it.The text was updated successfully, but these errors were encountered: