https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/87737
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n)
static_assert(!__is_layout_compatible(unsigned char, signed char));
static_assert(__is_layout_compatible(int[], int[]));
static_assert(__is_layout_compatible(int[2], int[2]));
- static_assert(!__is_layout_compatible
https://github.com/Endilll updated
https://github.com/llvm/llvm-project/pull/87737
>From ef24f642ca78d357018d6023fb3d9011f115299b Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov
Date: Fri, 5 Apr 2024 06:22:35 +0300
Subject: [PATCH 1/2] [clang] Reject VLAs in `__is_layout_compatible()`
This i
https://github.com/cor3ntin approved this pull request.
Following discussions, LGTM but I'd like to make sure incomplete types don't
fall through the cracks
https://github.com/llvm/llvm-project/pull/87737
___
cfe-commits mailing list
cfe-commits@lists
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n)
static_assert(!__is_layout_compatible(unsigned char, signed char));
static_assert(__is_layout_compatible(int[], int[]));
static_assert(__is_layout_compatible(int[2], int[2]));
- static_assert(!__is_layout_compatible
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n)
static_assert(!__is_layout_compatible(unsigned char, signed char));
static_assert(__is_layout_compatible(int[], int[]));
static_assert(__is_layout_compatible(int[2], int[2]));
- static_assert(!__is_layout_compatible
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n)
static_assert(!__is_layout_compatible(unsigned char, signed char));
static_assert(__is_layout_compatible(int[], int[]));
static_assert(__is_layout_compatible(int[2], int[2]));
- static_assert(!__is_layout_compatible
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n)
static_assert(!__is_layout_compatible(unsigned char, signed char));
static_assert(__is_layout_compatible(int[], int[]));
static_assert(__is_layout_compatible(int[2], int[2]));
- static_assert(!__is_layout_compatible
AaronBallman 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-compat
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](ht
philnik777 wrote:
I think clang should reject incomplete types when the standard says so. It
doesn't seem particularly useful to accept some special cases but reject
incomplete types in general. All the traits should probably be audited once. It
looks like Clang has other problematic cases: ht
cor3ntin wrote:
The library does require complete types, interesting
https://eel.is/c++draft/meta
However, at the language level, I cannot find any wording either way.
https://github.com/llvm/llvm-project/pull/87737
___
cfe-commits mailing list
cfe-c
AaronBallman wrote:
> We should not reject (ie, make the programm ill-form) _any_ type. Just return
> `false` in all of these cases
GCC rejects incomplete types: https://godbolt.org/z/xWbes5Wsc
Both Clang and GCC reject instantiating templates with VLAs but accept it in
the builtin: https://go
cor3ntin wrote:
We should not reject (ie, make the programm ill-form) _any_ type. Just return
`false` in all of these cases
https://github.com/llvm/llvm-project/pull/87737
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/
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
cor3ntin 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,
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Vlad Serebrennikov (Endilll)
Changes
This is a follow-up to #81506. Since `__is_layout_compatible()` is a
C++ intrinsic
(https://github.com/llvm/llvm-project/blob/ff1e72d68d1224271801ff5192a8c14fbd3be83b/clang/include/clang/Basic/TokenKin
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/87737
This is a follow-up to #81506. Since `__is_layout_compatible()` is a C++
intrinsic
(https://github.com/llvm/llvm-project/blob/ff1e72d68d1224271801ff5192a8c14fbd3be83b/clang/include/clang/Basic/TokenKinds.def#L52
18 matches
Mail list logo