Skip to content

Commit 358868a

Browse files
Restore implicitly converting cases in the test for P0466R5 (#5737)
1 parent 5913185 commit 358868a

File tree

1 file changed

+5
-0
lines changed
  • tests/std/tests/P0466R5_layout_compatibility_and_pointer_interconvertibility_traits

1 file changed

+5
-0
lines changed

tests/std/tests/P0466R5_layout_compatibility_and_pointer_interconvertibility_traits/test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ constexpr bool test() {
176176
}
177177
};
178178

179+
struct NS : S1, S2 {}; // Non-standard layout
180+
179181
ASSERT(is_corresponding_member(&S1::v1, &S::v1));
180182
ASSERT(is_corresponding_member(&S1::v2, &S::v2));
181183
ASSERT(is_corresponding_member(&S1::v1, &S1::v1));
@@ -197,6 +199,7 @@ constexpr bool test() {
197199
ASSERT(!is_corresponding_member(&S5::v1, &S6::v2));
198200
ASSERT(!is_corresponding_member(&S5::v2, &S6::v1));
199201
ASSERT(!is_corresponding_member(&S5::v3, &S6::v3));
202+
ASSERT(!is_corresponding_member<NS, NS, int, int>(&NS::v1, &NS::w1));
200203
ASSERT(!is_corresponding_member(&S7::f1, &S7::f1));
201204
ASSERT(!is_corresponding_member(static_cast<int S1::*>(nullptr), static_cast<int S2::*>(nullptr)));
202205
ASSERT(!is_corresponding_member(&S1::v1, static_cast<int S2::*>(nullptr)));
@@ -230,6 +233,8 @@ constexpr bool test() {
230233
ASSERT(is_pointer_interconvertible_with_class(&U::v1));
231234
ASSERT(is_pointer_interconvertible_with_class(&U::v2));
232235

236+
ASSERT(!is_pointer_interconvertible_with_class<NS, int>(&NS::a));
237+
ASSERT(!is_pointer_interconvertible_with_class<NS, int>(&NS::b));
233238
ASSERT(!is_pointer_interconvertible_with_class(&C::f1));
234239
ASSERT(!is_pointer_interconvertible_with_class(static_cast<int A::*>(nullptr)));
235240
}

0 commit comments

Comments
 (0)