Since we've decided the to not support std::experimental::coroutine*, we should tell the user they need to update.
We could emit warning on the compiler side or in libc++'s side by #warning directives.
I choose to warn on the compiler side since some people might use libstdc++ + self-defined coroutine header (Seastar is an example: https://github.com/scylladb/seastar/blob/master/include/seastar/core/std-coroutine.hh).
Since new warning might break the libcxx's CI system, I add -Wno-coroutine for the legacy tests. I guess it would be OK since the legacy test would be removed.
Details
- Reviewers
• Quuxplusone ldionne Mordante - Group Reviewers
Restricted Project - Commits
- rGaf9f3c6d86b4: [Coroutine] Warn deprecated 'std::experimental::coro' uses
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM with some suggestions, thanks for adding this notice!
clang/include/clang/Basic/DiagnosticGroups.td | ||
---|---|---|
57–60 | ||
clang/include/clang/Basic/DiagnosticSemaKinds.td | ||
11015–11017 | I would simply reword as "Please move from std::experimental::%0 to std::%0. Support for std::experimental::%0 will be removed in LLVM 15." IMO the set of users defining their own coroutines header is small and it's not worth making the warning more obtuse for that corner case. | |
libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg | ||
8 |
Thanks for working on this and landing the coroutines. LGTM after applying @ldionne's suggestions.
clang/include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
11015–11017 | +1; people who write their own "coroutine.h" header are also operating outside of standard C++ and outside of the Clang/libc++ ecosystem, so they should be quite used to figuring things out for themselves. If they want friendly help from the toolchain, they should use the toolchain's headers. | |
clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp | ||
53 | I'd like to see the next word in this diagnostic. (Ditto throughout. I'd also like to make sure that the diagnostic is not being printed with single-quotes in the wrong place, e.g. Found deprecated std::experimental::'coroutine_handle'; if it is, please fix that.) This code is also misindented; please fix it up, as long as you're touching it. Should be for co_await (auto i : arr) {} |
clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp | ||
---|---|---|
53 | Oh, clang-format couldn't recognize the new grammar. I need to be careful to use it to format codes. | |
libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg | ||
8 | Since the option is new added, I wonder if the CI would break if it didn't update compiler in time. (Or if it would run CI for previous compiler). Let's see if the CI would be green. |
Use -Wno-coroutine instead of -Wno-deprectated-experimental-coroutine to keep CI stable.
The CI fails. But I guess it would be irrelevant with this diff:
/var/lib/buildkite-agent/builds/llvm-project/libcxx/.clang-format:6:17: error: invalid boolean SpacesInAngles: Leave ^~~~~ Error reading /var/lib/buildkite-agent/builds/llvm-project/libcxx/.clang-format: Invalid argument
FWIW, the problem with
SpacesInAngles: Leave ^~~~~
is that the debian builder has an outdated (or maybe just 13.x?) clang-format; this option is super new. I don't know what the appropriate course of action is, there.
clang/include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
11015–11017 | Nit: s/Warning </Warning</ | |
clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp | ||
53 | FYI: I'd prefer a space before the (. Compare for (~~~), for co_await (~~~). (I've left a comment in the clang-format Discord channel, too.) | |
libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp | ||
10 | Doesn't the change in lit.local.cfg make this change redundant? |