[PATCH] D156247: [Clang] Add a warning on uses of coroutine keywords

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 26 11:13:56 PDT 2023


aaron.ballman added a comment.

In D156247#4536034 <https://reviews.llvm.org/D156247#4536034>, @tahonermann wrote:

>> You are absolutely right, -fno-coroutines would totally work for us, had it been available.
>
> Good. Gcc handles `-fcoroutines` and `-fno-coroutines` as I would expect (https://godbolt.org/z/7zEMd7cdW), so matching gcc behavior makes sense in any case. I would expect implementation to be quite straight forward, so I recommend we head in that direction.

I think we generally want to avoid "congratulatory" diagnostics unless the language feature is truly surprising to users in practice. e.g., we have `-Wvla` as a diagnostic to tell users when they're using a VLA because of just how often people think `const int i = 12; int array[i];` forms a constant-sized array when it doesn't (and VLAs can have security implications). There's nothing about coroutines that seems like it would surprise users such that they need a diagnostic to tell them they're using the feature. So I don't think this meets the bar for a diagnostic in Clang.

That said, I think `-fno-coroutines` should work.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156247/new/

https://reviews.llvm.org/D156247



More information about the cfe-commits mailing list