[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
Tue May 2 05:57:04 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:
> Fznamznon wrote:
> > 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.
> Oh, that might be worth leaving alone then, but put a comment next to the diagnostic definition to explain the relationship to `TagTypeKind`.
Sure, added a comment above the first diagnostic that uses the same structure.
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