ChuanqiXu added inline comments.
================ Comment at: clang/test/SemaCXX/coroutines.cpp:987 +// +// So it isn't ill-formed if the promise doesn't define return_value and return_void. It is just a UB. +coro<promise_no_return_func> no_return_value_or_return_void() { ---------------- Quuxplusone wrote: > It's not UB; it's //potential// UB. > My understanding is that such a coroutine could still be used: > - if it exits by throwing an exception instead of `co_return`'ing > - if it suspends and then its caller `destroy`s it instead of `resume`ing it > > I believe it would be useful to have some actual tests for these scenarios, > that would actually run and check that the runtime behavior is correct, or at > least check the IR that was generated. Is that possible? Yes, such a coroutine could still be used. AFAIK, we couldn't make tests which would run actually. All the test cases I know is about pattern match. So we couldn't make tests in clang to run actually for this. I have tested it locally. And I think it is unnecessary to check the IR was generated since this patch didn't add new statements except a null statement as marker. BTW, it shows another big issue for coroutines. We lack test-suite and benchmarks now. Now I tested the correctness of the compiler by test it in our internal projects. But we need an open source test suites absolutely. This is true for benchmarks. I thought to make the two things... but I don't find time for it now... CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116204/new/ https://reviews.llvm.org/D116204 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits