[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 17 11:10:59 PDT 2022


aaron.ballman added a subscriber: rsmith.
aaron.ballman added a comment.

In D125259#3519947 <https://reviews.llvm.org/D125259#3519947>, @aaron.ballman wrote:

> Oh wow, good catch! I'll correct this.

Oof, the plot thickens... the diagnostic is correct for some types, but is incorrect for others: https://godbolt.org/z/fahzx53W6. I also discovered a parsing issue in C++ where we get confused by elaborated type specifiers: https://godbolt.org/z/1ejxqd9ss.

I'm questioning the benefit to supporting `_Generic` in C++ and starting to wonder if perhaps we should pull this extension back. C++ already has a rich type system that can accomplish the same thing and we're not following the C semantics so there's not really an argument to be made for the extension letting people write code in both languages. @rsmith, do you have thoughts about that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125259



More information about the cfe-commits mailing list