[PATCH] D134791: [clang] Unify Sema and CodeGen implementation of isFlexibleArrayMemberExpr

2022-09-30 Thread Martin Sebor via Phabricator via cfe-commits
msebor added a comment. Thanks for the heads up! My only general comment is that unless this change has no externally observable effect I'd suggest adding tests. (Otherwise, noting it has no such effect would be helpful.) When I'm not familiar with the code (and often even what I am) I

[PATCH] D134311: [clang] handle extended integer constant expressions in _Static_assert (PR #57687)

2022-09-28 Thread Martin Sebor via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa181de452df3: [clang] handle extended integer constant expressions in _Static_assert (PR… (authored by msebor). Changed prior to commit:

[PATCH] D134311: [clang] handle extended integer constant expressions in _Static_assert (PR #57687)

2022-09-28 Thread Martin Sebor via Phabricator via cfe-commits
msebor added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:16733 + while (auto *BaseCast = dyn_cast(BaseExpr)) +BaseExpr = BaseCast->getSubExpr(); +} aaron.ballman wrote: > tbaeder wrote: > > There is `Expr::ignoreParenImpCasts()`

[PATCH] D134311: [clang] handle extended integer constant expressions in _Static_assert (PR #57687)

2022-09-28 Thread Martin Sebor via Phabricator via cfe-commits
msebor updated this revision to Diff 463607. msebor marked an inline comment as done. msebor added a comment. Changes from previous version: - Replace loop with `Expr::IgnoreImpCasts()`. - Use a multiline comment in a test to improve readability. CHANGES SINCE LAST ACTION

[PATCH] D134311: [clang] handle extended integer constant expressions in _Static_assert (PR #57687)

2022-09-20 Thread Martin Sebor via Phabricator via cfe-commits
msebor updated this revision to Diff 461744. msebor added a comment. Update to the latest diff that didn't get picked up in the first submission. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134311/new/ https://reviews.llvm.org/D134311 Files:

[PATCH] D133108: [clang] Rework IsTailPaddedMemberArray into isFlexibleArrayMemberExpr

2022-09-20 Thread Martin Sebor via Phabricator via cfe-commits
msebor added inline comments. Comment at: clang/test/Sema/unbounded-array-bounds.c:101 + char tail[1]; // addr16-note {{declared here}} addr32-note {{declared here}} +} fam1; + msebor wrote: > There's a difference between the sizes of `fam1` and `fam` that

[PATCH] D133108: [clang] Rework IsTailPaddedMemberArray into isFlexibleArrayMemberExpr

2022-09-20 Thread Martin Sebor via Phabricator via cfe-commits
msebor added inline comments. Comment at: clang/test/Sema/unbounded-array-bounds.c:101 + char tail[1]; // addr16-note {{declared here}} addr32-note {{declared here}} +} fam1; + There's a difference between the sizes of `fam1` and `fam` that makes accesses to

[PATCH] D134311: [clang] handle extended integer constant expressions in _Static_assert (PR #57687)

2022-09-20 Thread Martin Sebor via Phabricator via cfe-commits
msebor created this revision. msebor added a reviewer: aaron.ballman. Herald added a project: All. msebor requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The discussion in PR #57687

[PATCH] D133108: [clang] Rework IsTailPaddedMemberArray into isFlexibleArrayMemberExpr

2022-09-13 Thread Martin Sebor via Phabricator via cfe-commits
msebor added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:15969 + if (const MemberExpr *ME = dyn_cast(BaseExpr)) +ND = ME->getMemberDecl(); + I'm not familiar with this code but I'm guessing that at most one of the `if` conditionals is

[PATCH] D126864: [clang] Introduce -fstrict-flex-arrays= for stricter handling of flexible arrays

2022-09-12 Thread Martin Sebor via Phabricator via cfe-commits
msebor added inline comments. Comment at: clang/docs/ClangCommandLineReference.rst:2648 + +Control which arrays are considered as flexible arrays members. +can be 1 (array of size 0, 1 and undefined are considered) or 2 (array of size 0 aaron.ballman wrote: >

[PATCH] D126864: [clang] Introduce -fstrict-flex-arrays= for stricter handling of flexible arrays

2022-06-29 Thread Martin Sebor via Phabricator via cfe-commits
msebor added a comment. In D126864#3616524 , @serge-sans-paille wrote: > GCC and Clang don't have the same behavior wrt. macros-as-abound and > standard-layout-requirement, see https://godbolt.org/z/3vc4TcTYz > I'm fine with keeping the CLang behavior,

[PATCH] D126864: [clang] Introduce -fstrict-flex-arrays for stricter handling of flexible arrays

2022-06-09 Thread Martin Sebor via Phabricator via cfe-commits
msebor added a comment. Quite a bit more code treats one-element trailing arrays as flexible array members than larger arrays, and may not be able to change (GCC is one example). I wonder if it would be worthwhile to make it possible for code to specify that mode (e.g., by adding two options,