1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-08 23:24:20 +00:00

fix wshadow (#354)

This commit is contained in:
Daniil Goncharov 2024-05-25 17:35:16 +03:00 committed by GitHub
parent a2077c01c3
commit 801c68bdc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@ include(CheckCXXCompilerFlag)
set(CMAKE_CXX_STANDARD 17)
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set(OPTIONS -Wall -Wextra -pedantic-errors -Werror)
set(OPTIONS -Wall -Wextra -Wshadow -pedantic-errors -Werror)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(OPTIONS /W4 /WX)
if(HAS_PERMISSIVE_FLAG)

View file

@ -264,8 +264,8 @@ struct FilteredIterator {
constexpr explicit FilteredIterator(const FilteredIterator<OtherParent, OtherIterator, Getter, Predicate>& other)
: parent(other.parent), first(other.first), last(other.last), current(other.current), getter(other.getter), predicate(other.predicate) {}
constexpr FilteredIterator(Parent p, Iterator begin, Iterator end, Iterator curr, Getter getter = {}, Predicate pred = {})
: parent(p), first(std::move(begin)), last(std::move(end)), current(std::move(curr)), getter{std::move(getter)}, predicate{std::move(pred)} {
constexpr FilteredIterator(Parent p, Iterator begin, Iterator end, Iterator curr, Getter get = {}, Predicate pred = {})
: parent(p), first(std::move(begin)), last(std::move(end)), current(std::move(curr)), getter{std::move(get)}, predicate{std::move(pred)} {
if (current == first && !predicate(parent, current)) {
++*this;
}
@ -501,9 +501,9 @@ class bitset {
std::size_t num_index;
base_type bit_index;
constexpr reference_impl(parent_t parent, std::size_t ix) noexcept : reference_impl(parent, std::pair{ix / bits_per_base, base_type{1} << (ix % bits_per_base)}) {}
constexpr reference_impl(parent_t p, std::size_t i) noexcept : reference_impl(p, std::pair{i / bits_per_base, base_type{1} << (i % bits_per_base)}) {}
constexpr reference_impl(parent_t parent, std::pair<std::size_t, base_type> ix) noexcept : parent(parent), num_index(std::get<0>(ix)), bit_index(std::get<1>(ix)) {}
constexpr reference_impl(parent_t p, std::pair<std::size_t, base_type> i) noexcept : parent(p), num_index(std::get<0>(i)), bit_index(std::get<1>(i)) {}
public:
constexpr reference_impl& operator=(bool v) noexcept {

View file

@ -12,7 +12,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
check_cxx_compiler_flag(/std:c++latest HAS_CPPLATEST_FLAG)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_VERBOSE_MAKEFILE ON)
set(OPTIONS -Wall -Wextra -pedantic-errors -Werror)
set(OPTIONS -Wall -Wextra -Wshadow -pedantic-errors -Werror)
check_cxx_compiler_flag(-std=c++20 HAS_CPP20_FLAG)
check_cxx_compiler_flag(-std=c++23 HAS_CPP23_FLAG)