From b125a81e1876408a5fc4f5335a058bd9879d384c Mon Sep 17 00:00:00 2001 From: futuarmo Date: Wed, 21 Oct 2020 19:59:04 +0300 Subject: [PATCH 1/3] Unsigned changed to unsigned int due to convention --- tests/std/tests/P0088R3_variant/test.cpp | 56 ++++++------ tests/std/tests/P0220R1_optional/test.cpp | 16 ++-- tests/std/tests/P0898R3_concepts/test.cpp | 106 +++++++++++----------- 3 files changed, 89 insertions(+), 89 deletions(-) diff --git a/tests/std/tests/P0088R3_variant/test.cpp b/tests/std/tests/P0088R3_variant/test.cpp index 2857e561b3a..5606448bdfc 100644 --- a/tests/std/tests/P0088R3_variant/test.cpp +++ b/tests/std/tests/P0088R3_variant/test.cpp @@ -2135,7 +2135,7 @@ void test_copy_assignment_same_index() { assert(std::get<0>(v1) == 42); } { - using V = std::variant; + using V = std::variant; V v1(43l); V v2(42l); V &vref = (v1 = v2); @@ -2144,7 +2144,7 @@ void test_copy_assignment_same_index() { assert(std::get<1>(v1) == 42); } { - using V = std::variant; + using V = std::variant; V v1(std::in_place_type, 43); V v2(std::in_place_type, 42); CopyAssign::reset(); @@ -2192,7 +2192,7 @@ void test_copy_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(43l); V v2(42l); v = v2; @@ -2206,7 +2206,7 @@ void test_copy_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(std::in_place_type, 43); V v2(std::in_place_type, 42); v = v2; @@ -2220,7 +2220,7 @@ void test_copy_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(std::in_place_type, 43); V v2(std::in_place_type, 42); v = v2; @@ -2236,7 +2236,7 @@ void test_copy_assignment_same_index() { void test_copy_assignment_different_index() { { - using V = std::variant; + using V = std::variant; V v1(43); V v2(42l); V &vref = (v1 = v2); @@ -2245,9 +2245,9 @@ void test_copy_assignment_different_index() { assert(std::get<1>(v1) == 42); } { - using V = std::variant; + using V = std::variant; CopyAssign::reset(); - V v1(std::in_place_type, 43u); + V v1(std::in_place_type, 43u); V v2(std::in_place_type, 42); assert(CopyAssign::copy_construct == 0); assert(CopyAssign::move_construct == 0); @@ -2326,7 +2326,7 @@ void test_copy_assignment_different_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(43); V v2(42l); v = v2; @@ -2340,8 +2340,8 @@ void test_copy_assignment_different_index() { { struct { constexpr Result operator()() const { - using V = std::variant; - V v(std::in_place_type, 43u); + using V = std::variant; + V v(std::in_place_type, 43u); V v2(std::in_place_type, 42); v = v2; return {v.index(), std::get<1>(v).value}; @@ -2707,7 +2707,7 @@ void test_move_assignment_same_index() { assert(std::get<0>(v1) == 42); } { - using V = std::variant; + using V = std::variant; V v1(43l); V v2(42l); V &vref = (v1 = std::move(v2)); @@ -2716,7 +2716,7 @@ void test_move_assignment_same_index() { assert(std::get<1>(v1) == 42); } { - using V = std::variant; + using V = std::variant; V v1(std::in_place_type, 43); V v2(std::in_place_type, 42); MoveAssign::reset(); @@ -2763,7 +2763,7 @@ void test_move_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(43l); V v2(42l); v = std::move(v2); @@ -2777,7 +2777,7 @@ void test_move_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(std::in_place_type, 43); V v2(std::in_place_type, 42); v = std::move(v2); @@ -2793,7 +2793,7 @@ void test_move_assignment_same_index() { void test_move_assignment_different_index() { { - using V = std::variant; + using V = std::variant; V v1(43); V v2(42l); V &vref = (v1 = std::move(v2)); @@ -2802,8 +2802,8 @@ void test_move_assignment_different_index() { assert(std::get<1>(v1) == 42); } { - using V = std::variant; - V v1(std::in_place_type, 43u); + using V = std::variant; + V v1(std::in_place_type, 43u); V v2(std::in_place_type, 42); MoveAssign::reset(); V &vref = (v1 = std::move(v2)); @@ -2843,7 +2843,7 @@ void test_move_assignment_different_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(43); V v2(42l); v = std::move(v2); @@ -2857,8 +2857,8 @@ void test_move_assignment_different_index() { { struct { constexpr Result operator()() const { - using V = std::variant; - V v(std::in_place_type, 43u); + using V = std::variant; + V v(std::in_place_type, 43u); V v2(std::in_place_type, 42); v = std::move(v2); return {v.index(), std::get<1>(v).value}; @@ -3107,7 +3107,7 @@ void test_T_assignment_basic() { #if 0 // TRANSITION, P0608 #ifndef TEST_VARIANT_ALLOWS_NARROWING_CONVERSIONS { - std::variant v; + std::variant v; v = 42; assert(v.index() == 1); assert(std::get<1>(v) == 42); @@ -4632,7 +4632,7 @@ void test_T_ctor_basic() { #if 0 // TRANSITION, P0608 #ifndef TEST_VARIANT_ALLOWS_NARROWING_CONVERSIONS { - constexpr std::variant v(42); + constexpr std::variant v(42); static_assert(v.index() == 1, ""); static_assert(std::get<1>(v) == 42, ""); } @@ -6073,7 +6073,7 @@ int run_test() { #include "variant_test_helpers.h" namespace visit { -enum CallType : unsigned { +enum CallType : unsigned int { CT_None, CT_NonConst = 1, CT_Const = 2, @@ -6082,8 +6082,8 @@ enum CallType : unsigned { }; inline constexpr CallType operator|(CallType LHS, CallType RHS) { - return static_cast(static_cast(LHS) | - static_cast(RHS)); + return static_cast(static_cast(LHS) | + static_cast(RHS)); } struct ForwardingCallObject { @@ -6617,10 +6617,10 @@ namespace msvc { // //===----------------------------------------------------------------------===// - enum CallType : unsigned { CT_None, CT_NonConst = 1, CT_Const = 2, CT_LValue = 4, CT_RValue = 8 }; + enum CallType : unsigned int { CT_None, CT_NonConst = 1, CT_Const = 2, CT_LValue = 4, CT_RValue = 8 }; constexpr CallType operator|(CallType LHS, CallType RHS) { - return static_cast(static_cast(LHS) | static_cast(RHS)); + return static_cast(static_cast(LHS) | static_cast(RHS)); } struct ForwardingCallObject { diff --git a/tests/std/tests/P0220R1_optional/test.cpp b/tests/std/tests/P0220R1_optional/test.cpp index a7bb292e541..d5f4b261cf3 100644 --- a/tests/std/tests/P0220R1_optional/test.cpp +++ b/tests/std/tests/P0220R1_optional/test.cpp @@ -5718,7 +5718,7 @@ class X { int i_; public: - static unsigned dtor_called; + static unsigned int dtor_called; X(int i) : i_(i) {} X(X&& x) = default; X& operator=(X&&) = default; @@ -5727,13 +5727,13 @@ class X friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} }; -unsigned X::dtor_called = 0; +unsigned int X::dtor_called = 0; class Y { int i_; public: - static unsigned dtor_called; + static unsigned int dtor_called; Y(int i) : i_(i) {} Y(Y&&) = default; ~Y() {++dtor_called;} @@ -5742,7 +5742,7 @@ class Y friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);} }; -unsigned Y::dtor_called = 0; +unsigned int Y::dtor_called = 0; class Z { @@ -6955,7 +6955,7 @@ class X { int i_; public: - static unsigned dtor_called; + static unsigned int dtor_called; X(int i) : i_(i) {} X(X&& x) = default; X& operator=(X&&) = default; @@ -6964,13 +6964,13 @@ class X friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} }; -unsigned X::dtor_called = 0; +unsigned int X::dtor_called = 0; class Y { int i_; public: - static unsigned dtor_called; + static unsigned int dtor_called; Y(int i) : i_(i) {} Y(Y&&) = default; ~Y() {++dtor_called;} @@ -6979,7 +6979,7 @@ class Y friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);} }; -unsigned Y::dtor_called = 0; +unsigned int Y::dtor_called = 0; class Z { diff --git a/tests/std/tests/P0898R3_concepts/test.cpp b/tests/std/tests/P0898R3_concepts/test.cpp index 80c224e7df3..6a3ece735e0 100644 --- a/tests/std/tests/P0898R3_concepts/test.cpp +++ b/tests/std/tests/P0898R3_concepts/test.cpp @@ -876,7 +876,7 @@ namespace test_integral_concepts { STATIC_ASSERT(test_integral()); STATIC_ASSERT(test_integral()); - STATIC_ASSERT(test_integral()); + STATIC_ASSERT(test_integral()); STATIC_ASSERT(test_integral()); STATIC_ASSERT(test_integral()); @@ -934,7 +934,7 @@ namespace test_floating_point { STATIC_ASSERT(!test_floating_point()); STATIC_ASSERT(!test_floating_point()); - STATIC_ASSERT(!test_floating_point()); + STATIC_ASSERT(!test_floating_point()); STATIC_ASSERT(!test_floating_point()); STATIC_ASSERT(!test_floating_point()); @@ -2403,7 +2403,7 @@ namespace test_boolean_testable { }; STATIC_ASSERT(_Boolean_testable); - template // values in [0, Archetype_max) select a requirement to violate + template // values in [0, Archetype_max) select a requirement to violate struct Archetype { // clang-format off operator bool() const requires (Select != 0); // Archetype<0> is not implicitly convertible to bool @@ -2448,14 +2448,14 @@ namespace test_equality_comparable { STATIC_ASSERT(!test()); - template // selects one requirement to violate + template // selects one requirement to violate struct Archetype {}; - template + template bool operator==(Archetype const&); void operator==(Archetype<0> const&, Archetype<0> const&); // Archetype<0> == Archetype<0> is not _Boolean_testable - template + template bool operator!=(Archetype const&); void operator!=(Archetype<1> const&, Archetype<1> const&); // Archetype<1> != Archetype<1> is not _Boolean_testable @@ -2605,31 +2605,31 @@ namespace test_totally_ordered { STATIC_ASSERT(!test()); STATIC_ASSERT(!test()); - constexpr unsigned Archetype_max = 6; - template // values in [0, Archetype_max) select a requirement to violate + constexpr unsigned int Archetype_max = 6; + template // values in [0, Archetype_max) select a requirement to violate struct Archetype {}; - template + template bool operator==(Archetype const&); void operator==(Archetype<0> const&, Archetype<0> const&); - template + template bool operator!=(Archetype const&); void operator!=(Archetype<1> const&, Archetype<1> const&); - template + template bool operator<(Archetype const&); void operator<(Archetype<2> const&, Archetype<2> const&); - template + template bool operator>(Archetype const&); void operator>(Archetype<3> const&, Archetype<3> const&); - template + template bool operator<=(Archetype const&); void operator<=(Archetype<4> const&, Archetype<4> const&); - template + template bool operator>=(Archetype const&); void operator>=(Archetype<5> const&, Archetype<5> const&); @@ -3334,29 +3334,29 @@ namespace test_relation { operator bool() const; }; - template + template struct A {}; // clang-format off - template + template requires (0 < U) Bool operator==(A, A); // A<0> == A<0> is invalid // clang-format on STATIC_ASSERT(!test>()); STATIC_ASSERT(test>()); - template + template struct B {}; void operator==(B<1>, B<1>); // B<1> == B<1> does not model _Boolean_testable - template + template bool operator==(B, B); STATIC_ASSERT(test>()); STATIC_ASSERT(!test>()); // clang-format off - template + template requires (2 != I) bool operator==(A, B); // A<2> == B<2> rewrites to B<2> == A<2> - template + template requires (3 != I) bool operator==(B, A); // B<3> == A<3> rewrites to A<3> == B<3> // clang-format on @@ -3367,12 +3367,12 @@ namespace test_relation { STATIC_ASSERT(test, B<3>>()); STATIC_ASSERT(test, B<4>>()); - template + template struct C {}; enum E : bool { No, Yes }; E operator==(C<0>&, C<0>&); // const C<0> == const C<0> is invalid // clang-format off - template + template requires (0 != I) E operator==(C, C); // clang-format on @@ -3397,23 +3397,23 @@ namespace test_uniform_random_bit_generator { STATIC_ASSERT(uniform_random_bit_generator); struct NoCall { - static constexpr unsigned min() { + static constexpr unsigned int min() { return 0; } - static constexpr unsigned max() { + static constexpr unsigned int max() { return 42; } }; STATIC_ASSERT(!uniform_random_bit_generator); struct NoLvalueCall { - static constexpr unsigned min() { + static constexpr unsigned int min() { return 0; } - static constexpr unsigned max() { + static constexpr unsigned int max() { return 42; } - unsigned operator()() &&; + unsigned int operator()() &&; }; STATIC_ASSERT(!uniform_random_bit_generator); @@ -3429,21 +3429,21 @@ namespace test_uniform_random_bit_generator { STATIC_ASSERT(!uniform_random_bit_generator); struct NoMin { - static constexpr unsigned max() { + static constexpr unsigned int max() { return 42; } - unsigned operator()(); + unsigned int operator()(); }; STATIC_ASSERT(!uniform_random_bit_generator); struct NonConstexprMin { - static unsigned min() { + static unsigned int min() { return 0; } - static constexpr unsigned max() { + static constexpr unsigned int max() { return 42; } - unsigned operator()(); + unsigned int operator()(); }; STATIC_ASSERT(!uniform_random_bit_generator); @@ -3451,85 +3451,85 @@ namespace test_uniform_random_bit_generator { static constexpr int min() { return 0; } - static constexpr unsigned max() { + static constexpr unsigned int max() { return 42; } - unsigned operator()(); + unsigned int operator()(); }; STATIC_ASSERT(!uniform_random_bit_generator); struct NoMax { - static constexpr unsigned min() { + static constexpr unsigned int min() { return 0; } - unsigned operator()(); + unsigned int operator()(); }; STATIC_ASSERT(!uniform_random_bit_generator); struct NonConstexprMax { - static constexpr unsigned min() { + static constexpr unsigned int min() { return 0; } - static unsigned max() { + static unsigned int max() { return 42; } - unsigned operator()(); + unsigned int operator()(); }; STATIC_ASSERT(!uniform_random_bit_generator); struct BadMax { - static constexpr unsigned min() { + static constexpr unsigned int min() { return 0; } static constexpr int max() { return 42; } - unsigned operator()(); + unsigned int operator()(); }; STATIC_ASSERT(!uniform_random_bit_generator); struct EmptyRange { - static constexpr unsigned min() { + static constexpr unsigned int min() { return 0; } - static constexpr unsigned max() { + static constexpr unsigned int max() { return 0; } - unsigned operator()(); + unsigned int operator()(); }; STATIC_ASSERT(!uniform_random_bit_generator); struct ReversedRange { - static constexpr unsigned min() { + static constexpr unsigned int min() { return 42; } - static constexpr unsigned max() { + static constexpr unsigned int max() { return 0; } - unsigned operator()(); + unsigned int operator()(); }; STATIC_ASSERT(!uniform_random_bit_generator); struct URBG { - static constexpr unsigned min() { + static constexpr unsigned int min() { return 0; } - static constexpr unsigned max() { + static constexpr unsigned int max() { return 42; } - unsigned operator()(); + unsigned int operator()(); }; STATIC_ASSERT(uniform_random_bit_generator); STATIC_ASSERT(!uniform_random_bit_generator); struct ConstURBG { - static constexpr unsigned min() { + static constexpr unsigned int min() { return 0; } - static constexpr unsigned max() { + static constexpr unsigned int max() { return 42; } - unsigned operator()() const; + unsigned int operator()() const; }; STATIC_ASSERT(uniform_random_bit_generator); STATIC_ASSERT(uniform_random_bit_generator); From 2d6c5bdccd8685661daaff10075bc2d4d3257bc8 Mon Sep 17 00:00:00 2001 From: futuarmo Date: Thu, 22 Oct 2020 09:31:42 +0300 Subject: [PATCH 2/3] Reverted changes in extracted from libc++ code --- tests/std/tests/P0088R3_variant/test.cpp | 56 +++++++++++------------ tests/std/tests/P0220R1_optional/test.cpp | 16 +++---- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/std/tests/P0088R3_variant/test.cpp b/tests/std/tests/P0088R3_variant/test.cpp index 5606448bdfc..2857e561b3a 100644 --- a/tests/std/tests/P0088R3_variant/test.cpp +++ b/tests/std/tests/P0088R3_variant/test.cpp @@ -2135,7 +2135,7 @@ void test_copy_assignment_same_index() { assert(std::get<0>(v1) == 42); } { - using V = std::variant; + using V = std::variant; V v1(43l); V v2(42l); V &vref = (v1 = v2); @@ -2144,7 +2144,7 @@ void test_copy_assignment_same_index() { assert(std::get<1>(v1) == 42); } { - using V = std::variant; + using V = std::variant; V v1(std::in_place_type, 43); V v2(std::in_place_type, 42); CopyAssign::reset(); @@ -2192,7 +2192,7 @@ void test_copy_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(43l); V v2(42l); v = v2; @@ -2206,7 +2206,7 @@ void test_copy_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(std::in_place_type, 43); V v2(std::in_place_type, 42); v = v2; @@ -2220,7 +2220,7 @@ void test_copy_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(std::in_place_type, 43); V v2(std::in_place_type, 42); v = v2; @@ -2236,7 +2236,7 @@ void test_copy_assignment_same_index() { void test_copy_assignment_different_index() { { - using V = std::variant; + using V = std::variant; V v1(43); V v2(42l); V &vref = (v1 = v2); @@ -2245,9 +2245,9 @@ void test_copy_assignment_different_index() { assert(std::get<1>(v1) == 42); } { - using V = std::variant; + using V = std::variant; CopyAssign::reset(); - V v1(std::in_place_type, 43u); + V v1(std::in_place_type, 43u); V v2(std::in_place_type, 42); assert(CopyAssign::copy_construct == 0); assert(CopyAssign::move_construct == 0); @@ -2326,7 +2326,7 @@ void test_copy_assignment_different_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(43); V v2(42l); v = v2; @@ -2340,8 +2340,8 @@ void test_copy_assignment_different_index() { { struct { constexpr Result operator()() const { - using V = std::variant; - V v(std::in_place_type, 43u); + using V = std::variant; + V v(std::in_place_type, 43u); V v2(std::in_place_type, 42); v = v2; return {v.index(), std::get<1>(v).value}; @@ -2707,7 +2707,7 @@ void test_move_assignment_same_index() { assert(std::get<0>(v1) == 42); } { - using V = std::variant; + using V = std::variant; V v1(43l); V v2(42l); V &vref = (v1 = std::move(v2)); @@ -2716,7 +2716,7 @@ void test_move_assignment_same_index() { assert(std::get<1>(v1) == 42); } { - using V = std::variant; + using V = std::variant; V v1(std::in_place_type, 43); V v2(std::in_place_type, 42); MoveAssign::reset(); @@ -2763,7 +2763,7 @@ void test_move_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(43l); V v2(42l); v = std::move(v2); @@ -2777,7 +2777,7 @@ void test_move_assignment_same_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(std::in_place_type, 43); V v2(std::in_place_type, 42); v = std::move(v2); @@ -2793,7 +2793,7 @@ void test_move_assignment_same_index() { void test_move_assignment_different_index() { { - using V = std::variant; + using V = std::variant; V v1(43); V v2(42l); V &vref = (v1 = std::move(v2)); @@ -2802,8 +2802,8 @@ void test_move_assignment_different_index() { assert(std::get<1>(v1) == 42); } { - using V = std::variant; - V v1(std::in_place_type, 43u); + using V = std::variant; + V v1(std::in_place_type, 43u); V v2(std::in_place_type, 42); MoveAssign::reset(); V &vref = (v1 = std::move(v2)); @@ -2843,7 +2843,7 @@ void test_move_assignment_different_index() { { struct { constexpr Result operator()() const { - using V = std::variant; + using V = std::variant; V v(43); V v2(42l); v = std::move(v2); @@ -2857,8 +2857,8 @@ void test_move_assignment_different_index() { { struct { constexpr Result operator()() const { - using V = std::variant; - V v(std::in_place_type, 43u); + using V = std::variant; + V v(std::in_place_type, 43u); V v2(std::in_place_type, 42); v = std::move(v2); return {v.index(), std::get<1>(v).value}; @@ -3107,7 +3107,7 @@ void test_T_assignment_basic() { #if 0 // TRANSITION, P0608 #ifndef TEST_VARIANT_ALLOWS_NARROWING_CONVERSIONS { - std::variant v; + std::variant v; v = 42; assert(v.index() == 1); assert(std::get<1>(v) == 42); @@ -4632,7 +4632,7 @@ void test_T_ctor_basic() { #if 0 // TRANSITION, P0608 #ifndef TEST_VARIANT_ALLOWS_NARROWING_CONVERSIONS { - constexpr std::variant v(42); + constexpr std::variant v(42); static_assert(v.index() == 1, ""); static_assert(std::get<1>(v) == 42, ""); } @@ -6073,7 +6073,7 @@ int run_test() { #include "variant_test_helpers.h" namespace visit { -enum CallType : unsigned int { +enum CallType : unsigned { CT_None, CT_NonConst = 1, CT_Const = 2, @@ -6082,8 +6082,8 @@ enum CallType : unsigned int { }; inline constexpr CallType operator|(CallType LHS, CallType RHS) { - return static_cast(static_cast(LHS) | - static_cast(RHS)); + return static_cast(static_cast(LHS) | + static_cast(RHS)); } struct ForwardingCallObject { @@ -6617,10 +6617,10 @@ namespace msvc { // //===----------------------------------------------------------------------===// - enum CallType : unsigned int { CT_None, CT_NonConst = 1, CT_Const = 2, CT_LValue = 4, CT_RValue = 8 }; + enum CallType : unsigned { CT_None, CT_NonConst = 1, CT_Const = 2, CT_LValue = 4, CT_RValue = 8 }; constexpr CallType operator|(CallType LHS, CallType RHS) { - return static_cast(static_cast(LHS) | static_cast(RHS)); + return static_cast(static_cast(LHS) | static_cast(RHS)); } struct ForwardingCallObject { diff --git a/tests/std/tests/P0220R1_optional/test.cpp b/tests/std/tests/P0220R1_optional/test.cpp index d5f4b261cf3..a7bb292e541 100644 --- a/tests/std/tests/P0220R1_optional/test.cpp +++ b/tests/std/tests/P0220R1_optional/test.cpp @@ -5718,7 +5718,7 @@ class X { int i_; public: - static unsigned int dtor_called; + static unsigned dtor_called; X(int i) : i_(i) {} X(X&& x) = default; X& operator=(X&&) = default; @@ -5727,13 +5727,13 @@ class X friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} }; -unsigned int X::dtor_called = 0; +unsigned X::dtor_called = 0; class Y { int i_; public: - static unsigned int dtor_called; + static unsigned dtor_called; Y(int i) : i_(i) {} Y(Y&&) = default; ~Y() {++dtor_called;} @@ -5742,7 +5742,7 @@ class Y friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);} }; -unsigned int Y::dtor_called = 0; +unsigned Y::dtor_called = 0; class Z { @@ -6955,7 +6955,7 @@ class X { int i_; public: - static unsigned int dtor_called; + static unsigned dtor_called; X(int i) : i_(i) {} X(X&& x) = default; X& operator=(X&&) = default; @@ -6964,13 +6964,13 @@ class X friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} }; -unsigned int X::dtor_called = 0; +unsigned X::dtor_called = 0; class Y { int i_; public: - static unsigned int dtor_called; + static unsigned dtor_called; Y(int i) : i_(i) {} Y(Y&&) = default; ~Y() {++dtor_called;} @@ -6979,7 +6979,7 @@ class Y friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);} }; -unsigned int Y::dtor_called = 0; +unsigned Y::dtor_called = 0; class Z { From a402017359b02e1e3a3bc3e2e7ea0b1d7da3dff0 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 22 Oct 2020 09:09:37 -0700 Subject: [PATCH 3/3] Restore changes in the local part of the variant test --- tests/std/tests/P0088R3_variant/test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/std/tests/P0088R3_variant/test.cpp b/tests/std/tests/P0088R3_variant/test.cpp index 2857e561b3a..7a66a9f06e0 100644 --- a/tests/std/tests/P0088R3_variant/test.cpp +++ b/tests/std/tests/P0088R3_variant/test.cpp @@ -6617,10 +6617,10 @@ namespace msvc { // //===----------------------------------------------------------------------===// - enum CallType : unsigned { CT_None, CT_NonConst = 1, CT_Const = 2, CT_LValue = 4, CT_RValue = 8 }; + enum CallType : unsigned int { CT_None, CT_NonConst = 1, CT_Const = 2, CT_LValue = 4, CT_RValue = 8 }; constexpr CallType operator|(CallType LHS, CallType RHS) { - return static_cast(static_cast(LHS) | static_cast(RHS)); + return static_cast(static_cast(LHS) | static_cast(RHS)); } struct ForwardingCallObject {