Reland: [clang][ExprConstant] fix __builtin_object_size for flexible array members
authorNick Desaulniers <ndesaulniers@google.com>
Tue, 23 May 2023 21:41:43 +0000 (14:41 -0700)
committerNick Desaulniers <ndesaulniers@google.com>
Tue, 23 May 2023 21:41:46 +0000 (14:41 -0700)
commit804af933f7310f78d91e13ad8a13b64b00249614
tree90be5672a3ea12d5232374919d0385315e2d9a89
parent9a6d49e2d0f92ddd6fe4c6588c59a2912dae1ced
Reland: [clang][ExprConstant] fix __builtin_object_size for flexible array members

As reported by @kees, GCC treats __builtin_object_size of structures
containing flexible array members (aka arrays with incomplete type) not
just as the sizeof the underlying type, but additionally the size of the
members in a designated initializer list.

Fixes: https://github.com/llvm/llvm-project/issues/62789

Reviewed By: erichkeane, efriedma

Differential Revision: https://reviews.llvm.org/D150892
clang/docs/ReleaseNotes.rst
clang/lib/AST/ExprConstant.cpp
clang/test/CodeGen/object-size.c