@@ -14,7 +14,6 @@ struct S { // Must be declared at namespace scope due to static data member
1414};
1515
1616constexpr bool test () {
17- #if defined(__cpp_lib_is_layout_compatible) && defined(__cpp_lib_is_pointer_interconvertible) // TRANSITION, LLVM-48860
1817 // is_layout_compatible tests
1918 {
2019 struct S0 {
@@ -42,14 +41,28 @@ constexpr bool test() {
4241 int v1;
4342
4443 private:
44+ #ifdef __clang__
45+ #pragma clang diagnostic push
46+ #pragma clang diagnostic ignored "-Wunused-private-field"
47+ #endif // defined(__clang__)
4548 int v2;
49+ #ifdef __clang__
50+ #pragma clang diagnostic pop
51+ #endif // defined(__clang__)
4652 };
4753
4854 struct S5 {
4955 int v1;
5056
5157 private:
58+ #ifdef __clang__
59+ #pragma clang diagnostic push
60+ #pragma clang diagnostic ignored "-Wunused-private-field"
61+ #endif // defined(__clang__)
5262 int v2;
63+ #ifdef __clang__
64+ #pragma clang diagnostic pop
65+ #endif // defined(__clang__)
5366 };
5467
5568 enum E1 { e1 , e2 , e3 , e4 };
@@ -94,13 +107,21 @@ constexpr bool test() {
94107 int : 0 ;
95108 };
96109 class D : public C {};
97- // Disable warning C4408: anonymous union did not declare any data members
110+ #ifdef __clang__
111+ #pragma clang diagnostic push
112+ #pragma clang diagnostic ignored "-Wmissing-declarations"
113+ #else // ^^^ defined(__clang__) / !defined(__clang__) vvv
98114#pragma warning(push)
99- #pragma warning(disable : 4408)
115+ #pragma warning(disable : 4408) // C4408: anonymous union did not declare any data members
116+ #endif // ^^^ !defined(__clang__) ^^^
100117 class E : public A {
101118 union {};
102119 };
120+ #ifdef __clang__
121+ #pragma clang diagnostic pop
122+ #else // ^^^ defined(__clang__) / !defined(__clang__) vvv
103123#pragma warning(pop)
124+ #endif // ^^^ !defined(__clang__) ^^^
104125 class F : private A {}; // Non-public inheritance
105126 class NS : public B , public C {}; // Non-standard layout
106127 class I ; // Incomplete
@@ -134,6 +155,7 @@ constexpr bool test() {
134155 ASSERT (!is_pointer_interconvertible_base_of_v<U, I>);
135156 }
136157
158+ #ifndef __clang__ // TRANSITION, LLVM-48860
137159 // is_corresponding_member tests
138160 {
139161 struct S1 {
@@ -238,7 +260,7 @@ constexpr bool test() {
238260 ASSERT (!is_pointer_interconvertible_with_class (&C::f1));
239261 ASSERT (!is_pointer_interconvertible_with_class (static_cast <int A::*>(nullptr )));
240262 }
241- #endif // ^^^ defined(__cpp_lib_is_layout_compatible) && defined(__cpp_lib_is_pointer_interconvertible) ^^^
263+ #endif // ^^^ no workaround ^^^
242264 return true ;
243265}
244266
0 commit comments