Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsigned changed to unsigned int due to convention #1390

Merged
merged 3 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions tests/std/tests/P0088R3_variant/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2135,7 +2135,7 @@ void test_copy_assignment_same_index() {
assert(std::get<0>(v1) == 42);
}
{
using V = std::variant<int, long, unsigned>;
using V = std::variant<int, long, unsigned int>;
V v1(43l);
V v2(42l);
V &vref = (v1 = v2);
Expand All @@ -2144,7 +2144,7 @@ void test_copy_assignment_same_index() {
assert(std::get<1>(v1) == 42);
}
{
using V = std::variant<int, CopyAssign, unsigned>;
using V = std::variant<int, CopyAssign, unsigned int>;
V v1(std::in_place_type<CopyAssign>, 43);
V v2(std::in_place_type<CopyAssign>, 42);
CopyAssign::reset();
Expand Down Expand Up @@ -2192,7 +2192,7 @@ void test_copy_assignment_same_index() {
{
struct {
constexpr Result<long> operator()() const {
using V = std::variant<int, long, unsigned>;
using V = std::variant<int, long, unsigned int>;
V v(43l);
V v2(42l);
v = v2;
Expand All @@ -2206,7 +2206,7 @@ void test_copy_assignment_same_index() {
{
struct {
constexpr Result<int> operator()() const {
using V = std::variant<int, TCopyAssign, unsigned>;
using V = std::variant<int, TCopyAssign, unsigned int>;
V v(std::in_place_type<TCopyAssign>, 43);
V v2(std::in_place_type<TCopyAssign>, 42);
v = v2;
Expand All @@ -2220,7 +2220,7 @@ void test_copy_assignment_same_index() {
{
struct {
constexpr Result<int> operator()() const {
using V = std::variant<int, TCopyAssignNTMoveAssign, unsigned>;
using V = std::variant<int, TCopyAssignNTMoveAssign, unsigned int>;
V v(std::in_place_type<TCopyAssignNTMoveAssign>, 43);
V v2(std::in_place_type<TCopyAssignNTMoveAssign>, 42);
v = v2;
Expand All @@ -2236,7 +2236,7 @@ void test_copy_assignment_same_index() {

void test_copy_assignment_different_index() {
{
using V = std::variant<int, long, unsigned>;
using V = std::variant<int, long, unsigned int>;
V v1(43);
V v2(42l);
V &vref = (v1 = v2);
Expand All @@ -2245,9 +2245,9 @@ void test_copy_assignment_different_index() {
assert(std::get<1>(v1) == 42);
}
{
using V = std::variant<int, CopyAssign, unsigned>;
using V = std::variant<int, CopyAssign, unsigned int>;
CopyAssign::reset();
V v1(std::in_place_type<unsigned>, 43u);
V v1(std::in_place_type<unsigned int>, 43u);
V v2(std::in_place_type<CopyAssign>, 42);
assert(CopyAssign::copy_construct == 0);
assert(CopyAssign::move_construct == 0);
Expand Down Expand Up @@ -2326,7 +2326,7 @@ void test_copy_assignment_different_index() {
{
struct {
constexpr Result<long> operator()() const {
using V = std::variant<int, long, unsigned>;
using V = std::variant<int, long, unsigned int>;
V v(43);
V v2(42l);
v = v2;
Expand All @@ -2340,8 +2340,8 @@ void test_copy_assignment_different_index() {
{
struct {
constexpr Result<int> operator()() const {
using V = std::variant<int, TCopyAssign, unsigned>;
V v(std::in_place_type<unsigned>, 43u);
using V = std::variant<int, TCopyAssign, unsigned int>;
V v(std::in_place_type<unsigned int>, 43u);
V v2(std::in_place_type<TCopyAssign>, 42);
v = v2;
return {v.index(), std::get<1>(v).value};
Expand Down Expand Up @@ -2707,7 +2707,7 @@ void test_move_assignment_same_index() {
assert(std::get<0>(v1) == 42);
}
{
using V = std::variant<int, long, unsigned>;
using V = std::variant<int, long, unsigned int>;
V v1(43l);
V v2(42l);
V &vref = (v1 = std::move(v2));
Expand All @@ -2716,7 +2716,7 @@ void test_move_assignment_same_index() {
assert(std::get<1>(v1) == 42);
}
{
using V = std::variant<int, MoveAssign, unsigned>;
using V = std::variant<int, MoveAssign, unsigned int>;
V v1(std::in_place_type<MoveAssign>, 43);
V v2(std::in_place_type<MoveAssign>, 42);
MoveAssign::reset();
Expand Down Expand Up @@ -2763,7 +2763,7 @@ void test_move_assignment_same_index() {
{
struct {
constexpr Result<long> operator()() const {
using V = std::variant<int, long, unsigned>;
using V = std::variant<int, long, unsigned int>;
V v(43l);
V v2(42l);
v = std::move(v2);
Expand All @@ -2777,7 +2777,7 @@ void test_move_assignment_same_index() {
{
struct {
constexpr Result<int> operator()() const {
using V = std::variant<int, TMoveAssign, unsigned>;
using V = std::variant<int, TMoveAssign, unsigned int>;
V v(std::in_place_type<TMoveAssign>, 43);
V v2(std::in_place_type<TMoveAssign>, 42);
v = std::move(v2);
Expand All @@ -2793,7 +2793,7 @@ void test_move_assignment_same_index() {

void test_move_assignment_different_index() {
{
using V = std::variant<int, long, unsigned>;
using V = std::variant<int, long, unsigned int>;
V v1(43);
V v2(42l);
V &vref = (v1 = std::move(v2));
Expand All @@ -2802,8 +2802,8 @@ void test_move_assignment_different_index() {
assert(std::get<1>(v1) == 42);
}
{
using V = std::variant<int, MoveAssign, unsigned>;
V v1(std::in_place_type<unsigned>, 43u);
using V = std::variant<int, MoveAssign, unsigned int>;
V v1(std::in_place_type<unsigned int>, 43u);
V v2(std::in_place_type<MoveAssign>, 42);
MoveAssign::reset();
V &vref = (v1 = std::move(v2));
Expand Down Expand Up @@ -2843,7 +2843,7 @@ void test_move_assignment_different_index() {
{
struct {
constexpr Result<long> operator()() const {
using V = std::variant<int, long, unsigned>;
using V = std::variant<int, long, unsigned int>;
V v(43);
V v2(42l);
v = std::move(v2);
Expand All @@ -2857,8 +2857,8 @@ void test_move_assignment_different_index() {
{
struct {
constexpr Result<long> operator()() const {
using V = std::variant<int, TMoveAssign, unsigned>;
V v(std::in_place_type<unsigned>, 43u);
using V = std::variant<int, TMoveAssign, unsigned int>;
V v(std::in_place_type<unsigned int>, 43u);
V v2(std::in_place_type<TMoveAssign>, 42);
v = std::move(v2);
return {v.index(), std::get<1>(v).value};
Expand Down Expand Up @@ -3107,7 +3107,7 @@ void test_T_assignment_basic() {
#if 0 // TRANSITION, P0608
#ifndef TEST_VARIANT_ALLOWS_NARROWING_CONVERSIONS
{
std::variant<unsigned, long> v;
std::variant<unsigned int, long> v;
v = 42;
assert(v.index() == 1);
assert(std::get<1>(v) == 42);
Expand Down Expand Up @@ -4632,7 +4632,7 @@ void test_T_ctor_basic() {
#if 0 // TRANSITION, P0608
#ifndef TEST_VARIANT_ALLOWS_NARROWING_CONVERSIONS
{
constexpr std::variant<unsigned, long> v(42);
constexpr std::variant<unsigned int, long> v(42);
static_assert(v.index() == 1, "");
static_assert(std::get<1>(v) == 42, "");
}
Expand Down Expand Up @@ -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,
Expand All @@ -6082,8 +6082,8 @@ enum CallType : unsigned {
};

inline constexpr CallType operator|(CallType LHS, CallType RHS) {
return static_cast<CallType>(static_cast<unsigned>(LHS) |
static_cast<unsigned>(RHS));
return static_cast<CallType>(static_cast<unsigned int>(LHS) |
static_cast<unsigned int>(RHS));
}

struct ForwardingCallObject {
Expand Down Expand Up @@ -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 };
CaseyCarter marked this conversation as resolved.
Show resolved Hide resolved

constexpr CallType operator|(CallType LHS, CallType RHS) {
return static_cast<CallType>(static_cast<unsigned>(LHS) | static_cast<unsigned>(RHS));
return static_cast<CallType>(static_cast<unsigned int>(LHS) | static_cast<unsigned int>(RHS));
}

struct ForwardingCallObject {
Expand Down
16 changes: 8 additions & 8 deletions tests/std/tests/P0220R1_optional/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5718,7 +5718,7 @@ class X
{
int i_;
public:
static unsigned dtor_called;
static unsigned int dtor_called;
CaseyCarter marked this conversation as resolved.
Show resolved Hide resolved
X(int i) : i_(i) {}
X(X&& x) = default;
X& operator=(X&&) = default;
Expand All @@ -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;}
Expand All @@ -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
{
Expand Down Expand Up @@ -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;
Expand All @@ -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;}
Expand All @@ -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
{
Expand Down
Loading