For code like:
struct foo { ... };
struct bar { struct foo foo; };
const struct foo my_foo = { ... };
struct bar my_bar = { .foo = my_foo };
Eli Friedman points out the relevant part of the C standard seems to
have some flexibility in what is considered a constant expression:
6.6 paragraph 10:
An implementation may accept other forms of constant expressions.
GCC 8 added support for these, so clang not supporting them has been a
constant thorn in the side of source code portability within the Linux
kernel.
Note to self:
If this lands in time to be backported to release/17.x (as I've tagged https://github.com/llvm/llvm-project/issues/44502 to that milestone), I'll need to rebase this patch and post to a branch as the result of:
https://discourse.llvm.org/t/llvm-17-x-release-notes-update/72292