[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

Harald van Dijk via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 21 08:34:55 PDT 2024


hvdijk wrote:

Flexible array initialization is, roughly, implemented as building a different type in which the flexible array member is replaced by an array of the right size, initializing that, and then pretending it was the original type. It does not surprise me too much that this does not work in constant expressions, that generally does not play well with any form of type punning, even otherwise well-defined type punning.

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


More information about the cfe-commits mailing list