This fixes a bunch of FIXME within IsTailPaddedMemberArray related code.
As a side effect, this now also triggers a warning when trying to access a
"struct hack" field with an index that cannot be represented in associated address space.
Differential D133108
[clang] Rework IsTailPaddedMemberArray into isFlexibleArrayMemberExpr serge-sans-paille on Sep 1 2022, 6:18 AM. Authored by
Details This fixes a bunch of FIXME within IsTailPaddedMemberArray related code. As a side effect, this now also triggers a warning when trying to access a
Diff Detail Event Timeline
Comment Actions Found a few more things while trying to convince myself this really is NFC, and I don't think it is. If you agree, then I think we should have some additional test coverage to show the behavioral changes.
Comment Actions Address minor nits, plus add a test case that showcases the extra (legitimate!) warning we now get when accessing a "struct hack" field with an index that cannot be represented in associated address space. Kudos to @aaron.ballman for spotting this one! As a comparison, current behavior for the same test case: https://godbolt.org/z/86Wcbrz5q (only the flexible array member is flagged with a warning, the struct hacks are ignored)
Comment Actions LGTM, though this should probably have a release note for it (we can augment the release note when we make further changes in this area).
|
depending on <ins>the value of</ins> -fstrict-flex-array <del>value</del><ins>.</ins>
(Sorry, the Suggest Edits button seems to be unavailable)