[PATCH] D150435: [clang] Fix crash on attempt to initialize union with flexible array member

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 16 08:24:41 PDT 2023


aaron.ballman added a comment.

The precommit CI failures seem unrelated to these changes.



================
Comment at: clang/test/Sema/init.c:168-169
+
+// GH61746
+union { char x[]; } r = {0}; // expected-error {{flexible array member 'x' in a union is not allowed}}
----------------
I think we might want to move this to its own test file so we can test the various edge cases. I'd like to see a RUN line that tests explicitly in `-fms-compatibility` mode to demonstrate that we do not issue this diagnostic, and RUN lines for C++ mode as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150435



More information about the cfe-commits mailing list