[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 5 05:39:03 PDT 2024
Endilll wrote:
> However, at the language level, I cannot find any wording either way.
In my reading, http://eel.is/c++draft/basic.types.general#11 makes any type layout-compatible with itself, and even ignores cv-qualification:
> Two types cv1 T1 and cv2 T2 are [layout-compatible types](http://eel.is/c++draft/basic.types.general#def:type,layout-compatible) if T1 and T2 are the same type, [layout-compatible enumerations](http://eel.is/c++draft/dcl.enum#def:layout-compatible,enumeration), or [layout-compatible standard-layout class types](http://eel.is/c++draft/class.mem#def:layout-compatible,class)[.](http://eel.is/c++draft/basic.types.general#11.sentence-1)
I find the gap between core language term and type trait rather unfortunate.
https://github.com/llvm/llvm-project/pull/87737
More information about the cfe-commits
mailing list