[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-22 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/85684 >From 6887adae7500c4791a8620fa5b558e195e2c64cc Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 18 Mar 2024 10:45:20 -0700 Subject: [PATCH] Check if Coroutine await_suspend type returns the right

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-20 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > I am confused. If we don't need to check whether a type can be converted to > > std::coroutine_handle, why do we still need EvaluateBinaryTypeTraits or > > similar things. > > I thought your previous comment was to show concern about exposing >

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-20 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > In SemaExprCXX.cpp there's EvaluateBinaryTypeTraits that I needed to expose > as suggested by the comment in SemaCoroutine. Is there an alternative way to > do type coercion/equivalence checks? I am confused. If we don't need to check whether a type can be converted to

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-20 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > I am confused. If we don't need to check whether a type can be converted to > std::coroutine_handle, why do we still need EvaluateBinaryTypeTraits or > similar things. I thought your previous comment was to show concern about exposing `EvaluateBinaryTypeTraits`

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-20 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > > I am also ok with changing the patch to reject programs whose await_suspend > > doesn't strictly return std::coroutine_handle if upstream prefers. > > It should be good to do that since it makes the behavior more conforming. And > maybe it is better to do this a

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-19 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/85684 >From 08de54f02038795924a6e5fdbcf51a496fcedf56 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 18 Mar 2024 10:45:20 -0700 Subject: [PATCH] Check if Coroutine await_suspend type returns the right

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I am also ok with changing the patch to reject programs whose await_suspend > doesn't strictly return std::coroutine_handle if upstream prefers. It should be good to do that since it makes the behavior more conforming. And maybe it is better to do this a seperate patch.

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-18 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/85684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-coroutines Author: Yuxuan Chen (yuxuanchen1997) Changes This patch aims to fix https://github.com/llvm/llvm-project/issues/77111 The original issue is crash-on-invalid. However, Clang currently accepts programs where `await_suspend` returns a type

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-18 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/85684 This patch aims to fix https://github.com/llvm/llvm-project/issues/77111 The original issue is crash-on-invalid. However, Clang currently accepts programs where `await_suspend` returns a type that's