Skip to content

Commit

Permalink
enable conversion error
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Jul 3, 2024
1 parent 33f7b72 commit 47a6cbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions include/aws/crt/Variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ namespace Aws
{
AWS_FATAL_ASSERT(other.m_index != -1);
m_index = other.m_index;
VisitorUtil<(Variant::IndexT)0, Ts...>::VisitBinary(this, other, CopyMoveConstructor());
VisitorUtil<0, Ts...>::VisitBinary(this, other, CopyMoveConstructor());
}

Variant(Variant &&other)
{
AWS_FATAL_ASSERT(other.m_index != -1);
m_index = other.m_index;
VisitorUtil<(Variant::IndexT)0, Ts...>::VisitBinary(this, std::move(other), CopyMoveConstructor());
VisitorUtil<0, Ts...>::VisitBinary(this, std::move(other), CopyMoveConstructor());
}

template <typename T, EnableIfOtherIsThisVariantAlternative<T> = 1> Variant(const T &val)
Expand Down Expand Up @@ -213,11 +213,11 @@ namespace Aws
{
Destroy();
m_index = other.m_index;
VisitorUtil<(Variant::IndexT)0, Ts...>::VisitBinary(this, other, CopyMoveConstructor());
VisitorUtil<0, Ts...>::VisitBinary(this, other, CopyMoveConstructor());
}
else
{
VisitorUtil<(Variant::IndexT)0, Ts...>::VisitBinary(this, other, CopyMoveAssigner());
VisitorUtil<0, Ts...>::VisitBinary(this, other, CopyMoveAssigner());
}
}
return *this;
Expand All @@ -232,11 +232,11 @@ namespace Aws
{
Destroy();
m_index = other.m_index;
VisitorUtil<(Variant::IndexT)0, Ts...>::VisitBinary(this, std::move(other), CopyMoveConstructor());
VisitorUtil<0, Ts...>::VisitBinary(this, std::move(other), CopyMoveConstructor());
}
else
{
VisitorUtil<(Variant::IndexT)0, Ts...>::VisitBinary(this, std::move(other), CopyMoveAssigner());
VisitorUtil<0, Ts...>::VisitBinary(this, std::move(other), CopyMoveAssigner());
};
}
return *this;
Expand Down Expand Up @@ -386,7 +386,7 @@ namespace Aws

template <typename VisitorT> void Visit(VisitorT &&visitor)
{
return VisitorUtil<(Variant::IndexT)0, Ts...>::Visit(this, std::forward<VisitorT>(visitor));
return VisitorUtil<0, Ts...>::Visit(this, std::forward<VisitorT>(visitor));
}

private:
Expand Down Expand Up @@ -473,7 +473,7 @@ namespace Aws
}
else
{
VisitorUtil<Index + (IndexT)1, Second, Rest...>::Visit(pThis, std::forward<VisitorStruct>(visitor));
VisitorUtil<Index + 1, Second, Rest...>::Visit(pThis, std::forward<VisitorStruct>(visitor));
}
}

Expand All @@ -490,7 +490,7 @@ namespace Aws
}
else
{
VisitorUtil<Index + (IndexT)1, Second, Rest...>::VisitBinary(
VisitorUtil<Index + 1, Second, Rest...>::VisitBinary(
pThis, std::forward<Variant<Ts...>>(other), std::forward<VisitorStruct>(visitor));
}
}
Expand All @@ -509,7 +509,7 @@ namespace Aws
}
else
{
VisitorUtil<Index + (IndexT)1, Second, Rest...>::VisitBinary(
VisitorUtil<Index + 1, Second, Rest...>::VisitBinary(
pThis, other, std::forward<VisitorStruct>(visitor));
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ if(AWS_WARNINGS_ARE_ERRORS)
if(MSVC)
target_compile_options(${TEST_BINARY_NAME} PRIVATE /W4 /WX /wd4068)
else()
target_compile_options(${TEST_BINARY_NAME} PRIVATE -Wall -Wno-long-long -Werror)
target_compile_options(${TEST_BINARY_NAME} PRIVATE -Wall -Wno-long-long -Werror -Wconversion)
endif()
endif()

Expand Down

0 comments on commit 47a6cbc

Please sign in to comment.