[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
ChuanqiXu marked 2 inline comments as done. ChuanqiXu added inline comments. Comment at: clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp:54 for -co_await(auto i : arr) {} +co_await(auto i : arr) {} // expected-warning {{Found deprecated std::experimental}} // expected-error@-1 {{call to deleted member function 'await_transform'}} Quuxplusone wrote: > ChuanqiXu wrote: > > Quuxplusone wrote: > > > 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) {} > > > ``` > > Oh, clang-format couldn't recognize the new grammar. I need to be careful > > to use it to format codes. > 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.) Thanks for issuing this! Comment at: libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp:10 // REQUIRES: fcoroutines-ts -// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts +// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts -Wno-coroutine Quuxplusone wrote: > Doesn't the change in lit.local.cfg make this change redundant? Yeah, this test isn't covered by `lit.local.cfg` below. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGaf9f3c6d86b4: [Coroutine] Warn deprecated std::experimental::coro uses (authored by ChuanqiXu). Changed prior to commit: https://reviews.llvm.org/D113977?vs=387828=388079#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaCoroutine.cpp clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp clang/test/SemaCXX/coreturn-eh-exp-namespace.cpp clang/test/SemaCXX/coreturn-exp-namespace.cpp clang/test/SemaCXX/coroutine-final-suspend-noexcept-exp-namespace.cpp clang/test/SemaCXX/coroutine-mixed2-exp-namespace.cpp clang/test/SemaCXX/coroutine-rvo-exp-namespace.cpp clang/test/SemaCXX/coroutine-seh-exp-namespace.cpp clang/test/SemaCXX/coroutine-traits-undefined-template-exp-namespace.cpp clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp clang/test/SemaCXX/coroutines-exp-namespace.cpp libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg Index: libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg === --- libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg +++ libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg @@ -5,3 +5,4 @@ config.unsupported = True else: config.test_format.addCompileFlags(config, '-fcoroutines-ts') + config.test_format.addCompileFlags(config, '-Wno-coroutine') Index: libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp === --- libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp +++ libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp @@ -7,7 +7,7 @@ //===--===// // REQUIRES: fcoroutines-ts -// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts +// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts -Wno-coroutine // A simple "breathing" test that checks that // can be parsed and used in all dialects, including C++03 in order to match Index: clang/test/SemaCXX/coroutines-exp-namespace.cpp === --- clang/test/SemaCXX/coroutines-exp-namespace.cpp +++ clang/test/SemaCXX/coroutines-exp-namespace.cpp @@ -83,7 +83,7 @@ struct DummyVoidTag {}; DummyVoidTag no_specialization() { // expected-error {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} - co_await a; + co_await a; // expected-warning {{Please move from std::experimental::coroutine_traits to std::coroutine_traits}} } template Index: clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp === --- clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp +++ clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp @@ -66,7 +66,7 @@ } a; task f() { - co_await a; + co_await a; // expected-warning {{Please move from std::experimental::coroutine_traits to std::coroutine_traits}} } int main() { Index: clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp === --- clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp +++ clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp @@ -5,7 +5,7 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts \ // RUN:-fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify \ // RUN:-fblocks -Wno-unreachable-code -Wno-unused-value \ -// RUN:-DDISABLE_WARNING -Wno-coroutine-missing-unhandled-exception +// RUN:-DDISABLE_WARNING -Wno-deprecated-experimental-coroutine -Wno-coroutine-missing-unhandled-exception #if __has_feature(cxx_exceptions) #error This test requires exceptions be disabled @@ -32,7 +32,7 @@ #ifndef DISABLE_WARNING void test0() { // expected-warning {{'promise_void' is required to declare the member 'unhandled_exception()' when exceptions are enabled}} - co_return; + co_return; // expected-warning {{Please move from std::experimental::coroutine_traits to
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
Quuxplusone accepted this revision as: Quuxplusone. Quuxplusone added a comment. 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. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:11015-11017 + "Found deprecated std::experimental::%0. Consider to update your libc++ " + "or move coroutine components into std namespace in case you are using " + "self-defined coroutine components">, Quuxplusone wrote: > ldionne wrote: > > 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. > +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. Nit: `s/Warning Quuxplusone wrote: > > 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) {} > > ``` > Oh, clang-format couldn't recognize the new grammar. I need to be careful to > use it to format codes. 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.) Comment at: libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp:10 // REQUIRES: fcoroutines-ts -// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts +// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts -Wno-coroutine Doesn't the change in lit.local.cfg make this change redundant? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
ChuanqiXu added a comment. 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 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
ChuanqiXu updated this revision to Diff 387828. ChuanqiXu marked 2 inline comments as done. ChuanqiXu added a comment. Use `-Wno-coroutine` instead of `-Wno-deprectated-experimental-coroutine` to keep CI stable. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaCoroutine.cpp clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp clang/test/SemaCXX/coreturn-eh-exp-namespace.cpp clang/test/SemaCXX/coreturn-exp-namespace.cpp clang/test/SemaCXX/coroutine-final-suspend-noexcept-exp-namespace.cpp clang/test/SemaCXX/coroutine-mixed2-exp-namespace.cpp clang/test/SemaCXX/coroutine-rvo-exp-namespace.cpp clang/test/SemaCXX/coroutine-seh-exp-namespace.cpp clang/test/SemaCXX/coroutine-traits-undefined-template-exp-namespace.cpp clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp clang/test/SemaCXX/coroutines-exp-namespace.cpp libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg Index: libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg === --- libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg +++ libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg @@ -5,3 +5,4 @@ config.unsupported = True else: config.test_format.addCompileFlags(config, '-fcoroutines-ts') + config.test_format.addCompileFlags(config, '-Wno-coroutine') Index: libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp === --- libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp +++ libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp @@ -7,7 +7,7 @@ //===--===// // REQUIRES: fcoroutines-ts -// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts +// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts -Wno-coroutine // A simple "breathing" test that checks that // can be parsed and used in all dialects, including C++03 in order to match Index: clang/test/SemaCXX/coroutines-exp-namespace.cpp === --- clang/test/SemaCXX/coroutines-exp-namespace.cpp +++ clang/test/SemaCXX/coroutines-exp-namespace.cpp @@ -83,7 +83,7 @@ struct DummyVoidTag {}; DummyVoidTag no_specialization() { // expected-error {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} - co_await a; + co_await a; // expected-warning {{Please move from std::experimental::coroutine_traits to std::coroutine_traits}} } template Index: clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp === --- clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp +++ clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp @@ -66,7 +66,7 @@ } a; task f() { - co_await a; + co_await a; // expected-warning {{Please move from std::experimental::coroutine_traits to std::coroutine_traits}} } int main() { Index: clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp === --- clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp +++ clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp @@ -5,7 +5,7 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts \ // RUN:-fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify \ // RUN:-fblocks -Wno-unreachable-code -Wno-unused-value \ -// RUN:-DDISABLE_WARNING -Wno-coroutine-missing-unhandled-exception +// RUN:-DDISABLE_WARNING -Wno-deprecated-experimental-coroutine -Wno-coroutine-missing-unhandled-exception #if __has_feature(cxx_exceptions) #error This test requires exceptions be disabled @@ -32,7 +32,7 @@ #ifndef DISABLE_WARNING void test0() { // expected-warning {{'promise_void' is required to declare the member 'unhandled_exception()' when exceptions are enabled}} - co_return; + co_return; // expected-warning {{Please move from std::experimental::coroutine_traits to std::coroutine_traits}} } #else void test0() { // expected-no-diagnostics Index: clang/test/SemaCXX/coroutine-traits-undefined-template-exp-namespace.cpp === ---
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
ChuanqiXu marked 5 inline comments as done. ChuanqiXu added inline comments. Comment at: clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp:54 for -co_await(auto i : arr) {} +co_await(auto i : arr) {} // expected-warning {{Found deprecated std::experimental}} // expected-error@-1 {{call to deleted member function 'await_transform'}} Quuxplusone wrote: > 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) {} > ``` Oh, clang-format couldn't recognize the new grammar. I need to be careful to use it to format codes. Comment at: libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg:8 config.test_format.addCompileFlags(config, '-fcoroutines-ts') + config.test_format.addCompileFlags(config, '-Wno-coroutine') ldionne wrote: > 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. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
ChuanqiXu updated this revision to Diff 387811. ChuanqiXu added a comment. Address comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaCoroutine.cpp clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp clang/test/SemaCXX/coreturn-eh-exp-namespace.cpp clang/test/SemaCXX/coreturn-exp-namespace.cpp clang/test/SemaCXX/coroutine-final-suspend-noexcept-exp-namespace.cpp clang/test/SemaCXX/coroutine-mixed2-exp-namespace.cpp clang/test/SemaCXX/coroutine-rvo-exp-namespace.cpp clang/test/SemaCXX/coroutine-seh-exp-namespace.cpp clang/test/SemaCXX/coroutine-traits-undefined-template-exp-namespace.cpp clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp clang/test/SemaCXX/coroutines-exp-namespace.cpp libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg Index: libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg === --- libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg +++ libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg @@ -5,3 +5,4 @@ config.unsupported = True else: config.test_format.addCompileFlags(config, '-fcoroutines-ts') + config.test_format.addCompileFlags(config, '-Wno-deprecated-experimental-coroutine') Index: libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp === --- libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp +++ libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp @@ -7,7 +7,7 @@ //===--===// // REQUIRES: fcoroutines-ts -// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts +// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts -Wno-deprecated-experimental-coroutine // A simple "breathing" test that checks that // can be parsed and used in all dialects, including C++03 in order to match Index: clang/test/SemaCXX/coroutines-exp-namespace.cpp === --- clang/test/SemaCXX/coroutines-exp-namespace.cpp +++ clang/test/SemaCXX/coroutines-exp-namespace.cpp @@ -83,7 +83,7 @@ struct DummyVoidTag {}; DummyVoidTag no_specialization() { // expected-error {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} - co_await a; + co_await a; // expected-warning {{Please move from std::experimental::coroutine_traits to std::coroutine_traits}} } template Index: clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp === --- clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp +++ clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp @@ -66,7 +66,7 @@ } a; task f() { - co_await a; + co_await a; // expected-warning {{Please move from std::experimental::coroutine_traits to std::coroutine_traits}} } int main() { Index: clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp === --- clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp +++ clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp @@ -5,7 +5,7 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts \ // RUN:-fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify \ // RUN:-fblocks -Wno-unreachable-code -Wno-unused-value \ -// RUN:-DDISABLE_WARNING -Wno-coroutine-missing-unhandled-exception +// RUN:-DDISABLE_WARNING -Wno-deprecated-experimental-coroutine -Wno-coroutine-missing-unhandled-exception #if __has_feature(cxx_exceptions) #error This test requires exceptions be disabled @@ -32,7 +32,7 @@ #ifndef DISABLE_WARNING void test0() { // expected-warning {{'promise_void' is required to declare the member 'unhandled_exception()' when exceptions are enabled}} - co_return; + co_return; // expected-warning {{Please move from std::experimental::coroutine_traits to std::coroutine_traits}} } #else void test0() { // expected-no-diagnostics Index: clang/test/SemaCXX/coroutine-traits-undefined-template-exp-namespace.cpp === --- clang/test/SemaCXX/coroutine-traits-undefined-template-exp-namespace.cpp +++
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
Quuxplusone requested changes to this revision. Quuxplusone added inline comments. This revision now requires changes to proceed. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:11015-11017 + "Found deprecated std::experimental::%0. Consider to update your libc++ " + "or move coroutine components into std namespace in case you are using " + "self-defined coroutine components">, ldionne wrote: > 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. +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. Comment at: clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp:54 for -co_await(auto i : arr) {} +co_await(auto i : arr) {} // expected-warning {{Found deprecated std::experimental}} // expected-error@-1 {{call to deleted member function 'await_transform'}} 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) {} ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
Mordante accepted this revision. Mordante added a comment. Thanks for working on this and landing the coroutines. LGTM after applying @ldionne's suggestions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
ldionne accepted this revision. ldionne added a comment. This revision is now accepted and ready to land. LGTM with some suggestions, thanks for adding this notice! Comment at: clang/include/clang/Basic/DiagnosticGroups.td:57-59 +def DeprecatedCorotuine : + DiagGroup<"deprecated-coroutine">; +def Coroutine : DiagGroup<"coroutine", [CoroutineMissingUnhandledException, DeprecatedCorotuine]>; Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:11015-11017 + "Found deprecated std::experimental::%0. Consider to update your libc++ " + "or move coroutine components into std namespace in case you are using " + "self-defined coroutine components">, 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. Comment at: libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg:8 config.test_format.addCompileFlags(config, '-fcoroutines-ts') + config.test_format.addCompileFlags(config, '-Wno-coroutine') Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113977/new/ https://reviews.llvm.org/D113977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D113977: [Coroutine] Warn deprecated 'std::experimental::coro' uses
ChuanqiXu created this revision. ChuanqiXu added reviewers: Quuxplusone, ldionne. ChuanqiXu added projects: clang, libc++. Herald added a subscriber: lxfind. ChuanqiXu requested review of this revision. Herald added subscribers: libcxx-commits, cfe-commits. Herald added a reviewer: libc++. 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D113977 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaCoroutine.cpp clang/test/SemaCXX/co_await-range-for-exp-namespace.cpp clang/test/SemaCXX/coreturn-eh-exp-namespace.cpp clang/test/SemaCXX/coreturn-exp-namespace.cpp clang/test/SemaCXX/coroutine-final-suspend-noexcept-exp-namespace.cpp clang/test/SemaCXX/coroutine-rvo-exp-namespace.cpp clang/test/SemaCXX/coroutine-seh-exp-namespace.cpp clang/test/SemaCXX/coroutine-traits-undefined-template-exp-namespace.cpp clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp clang/test/SemaCXX/coroutines-exp-namespace.cpp libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg Index: libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg === --- libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg +++ libcxx/test/std/experimental/language.support/support.coroutines/lit.local.cfg @@ -5,3 +5,4 @@ config.unsupported = True else: config.test_format.addCompileFlags(config, '-fcoroutines-ts') + config.test_format.addCompileFlags(config, '-Wno-coroutine') Index: libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp === --- libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp +++ libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp @@ -7,7 +7,7 @@ //===--===// // REQUIRES: fcoroutines-ts -// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts +// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts -Wno-coroutine // A simple "breathing" test that checks that // can be parsed and used in all dialects, including C++03 in order to match Index: clang/test/SemaCXX/coroutines-exp-namespace.cpp === --- clang/test/SemaCXX/coroutines-exp-namespace.cpp +++ clang/test/SemaCXX/coroutines-exp-namespace.cpp @@ -83,7 +83,7 @@ struct DummyVoidTag {}; DummyVoidTag no_specialization() { // expected-error {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} - co_await a; + co_await a; // expected-warning {{Found deprecated std::experimental}} } template Index: clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp === --- clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp +++ clang/test/SemaCXX/coroutine_handle-address-return-type-exp-namespace.cpp @@ -66,7 +66,7 @@ } a; task f() { - co_await a; + co_await a; // expected-warning {{Found deprecated std::experimental}} } int main() { Index: clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp === --- clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp +++ clang/test/SemaCXX/coroutine-unhandled_exception-warning-exp-namespace.cpp @@ -5,7 +5,7 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts \ // RUN:-fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify \ // RUN:-fblocks -Wno-unreachable-code -Wno-unused-value \ -// RUN:-DDISABLE_WARNING -Wno-coroutine-missing-unhandled-exception +// RUN:-DDISABLE_WARNING -Wno-deprecated-coroutine -Wno-coroutine-missing-unhandled-exception #if __has_feature(cxx_exceptions) #error This test requires exceptions be disabled @@ -32,7 +32,7 @@ #ifndef DISABLE_WARNING