[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 5 00:04:58 PDT 2024


Endilll wrote:

> I think the current behavior is reasonable-ish. Rejecting specific types is a bit weird... I think VLA should model incomplete types (but we currently don't reject that either, which is a bug)
> 
> IE, I would expect __is_layout_compatible to return false in the presence of VLAs, incomplete types, and FAM

My reading of your comment is that in the first paragraph you're asking both VLAs and incomplete types to be rejected, then in the second paragraph you're asking to extend the intrinsic to accept them and yield false. Can you pick one?

> (but we currently don't reject that either, which is a bug)

I'll address that in a follow-up PR, even though rejecting `__is_layout_compatible(IncompleteStruct, IncompleteStruct)` doesn't make sense to me.

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


More information about the cfe-commits mailing list