[libcxx-commits] [PATCH] D46140: [coroutines] Add std::experimental::task<T> type

Lewis Baker via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 26 23:06:04 PDT 2019


lewissbaker marked an inline comment as done.
lewissbaker added a comment.

@EricWF This implementation will currently not work with MSVC as MSVC does not yet support the symmetric-transfer capability added to the coroutines specification in P0913R0 <https://wg21.link/P0913R0>.

Is MSVC a target that libc++ needs to support coroutines with?
Or can we just say the `task<T>` class is unsupported for compilers that don't support P0913?

I have added the 'requires coroutines' line to the task modulemap entry which should hopefully fix the module build failures this diff was seeing.
Are there any other potential gotchas that I should make sure I test?



================
Comment at: test/std/experimental/task/task.basic/task_of_value.pass.cpp:25
+       auto p = std::make_unique<int>(123);
+       co_return p; // Should be implicit std::move(p) here.
+     }
----------------
@EricWF This line may fail to compile on older versions of clang without the coroutines bugfix for https://bugs.llvm.org/show_bug.cgi?id=37265.

Should I just change this back to `std::move(p)` here, since the intention is to test the library, not the compiler?
Alternatively I can conditionally compile this line as either `co_return p;` or `co_return std::move(p);` depending on the compiler version.


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D46140/new/

https://reviews.llvm.org/D46140





More information about the libcxx-commits mailing list