[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu May 1 12:02:01 PDT 2025


zygoloid wrote:

> Is the warning valid? Is the change in clang's behavior intentional?

What do you have `-fstrict-flex-arrays` set to? Per [the documentation](https://releases.llvm.org/15.0.0/tools/clang/docs/ClangCommandLineReference.html#cmdoption-clang-fstrict-flex-arrays) (which weirdly seems to be missing at HEAD...) if it's not set to `1` then we don't consider a `[1]` array bound to indicate a flexible array member, which would make the warning correct.

https://github.com/llvm/llvm-project/pull/95474


More information about the cfe-commits mailing list