[clang] Diagnose use of VLAs in a coroutine (PR #70341)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 26 08:15:05 PDT 2023


================
@@ -1198,6 +1198,11 @@ void Sema::CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *&Body) {
   if (FD->hasAttr<AlwaysInlineAttr>())
     Diag(FD->getLocation(), diag::warn_always_inline_coroutine);
 
+  // We don't allow use of VLAs within a coroutine, so diagnose if we've seen
----------------
ChuanqiXu9 wrote:

```suggestion
  // VLAs are not allowed within a coroutine, so diagnose if we've seen
```

nit: it is not us (clang/LLVM) who decide not to support VLA in coroutines. But C++20 coroutines itself doesn't support VLA by its design naturally.

https://github.com/llvm/llvm-project/pull/70341


More information about the cfe-commits mailing list