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

Mariya Podchishchaeva via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 28 10:24:56 PDT 2023


Fznamznon added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:6241-6244
 def ext_flexible_array_empty_aggregate_ms : Extension<
   "flexible array member %0 in otherwise empty "
   "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
   InGroup<MicrosoftFlexibleArray>;
----------------
aaron.ballman wrote:
> Should this be updated to remove the union case?
Sounds reasonable, but what is unfortunate is that this diagnostic exactly matches TagTypeKind enum, so now it can be emitted with `Diag(...) << ... << SomeTagDecl->getTagKind().` Once I remove `union` from there, this neat thing fails.


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