[PATCH] D147626: [clang] Reject flexible array member in a union in C++

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 10:52:08 PDT 2023


aaron.ballman added a comment.

In D147626#4316190 <https://reviews.llvm.org/D147626#4316190>, @efriedma wrote:

>> If there's not indications of this being disruptive on non-MSVC-compatible targets, then we may still be able to get away with rejecting the extension there.
>
> If we need to have the codepath anyway, there isn't much harm in allowing it on all targets, I think.  There's really only one possible interpretation for the construct.

You would think, except the GCC extension differs based on C vs C++: https://godbolt.org/z/E14Yz37To as does the extension in Clang, but differently than GCC: https://godbolt.org/z/zYznaYPf5 and so we'd also have to dig into solving that if we wanted to keep GCC compatibility behavior.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147626



More information about the cfe-commits mailing list