Neargye / magic_enum

Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code
MIT License
4.98k stars 444 forks source link

error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<T>::reference_impl<magic_enum::containers::bitset<T>*>’ [-Werror=shadow] #353

Closed alex-tee closed 6 months ago

alex-tee commented 6 months ago

I got the following error (with -Werror=shadow) when building with GCC 13.2.1 on Arch Linux. Seems to be completely inside magic_enum and not my code.

FAILED: src/libzrythm-lib.so.p/dsp_port_identifier.cpp.o 
ccache c++ -Isrc/libzrythm-lib.so.p -Isrc -I../src -I. -I.. -Iinc -I../inc -I../inc/plugins -Iext -I../ext -Iext/kissfft -I../ext/kissfft -Iext/midilib -I../ext/midilib -Iext/whereami -I../ext/whereami -Iext/weakjack -I../ext/weakjack -Isubprojects/libadwaita/src -I../subprojects/libadwaita/src -Isubprojects/gtk4 -I../subprojects/gtk4 -Isubprojects/gtk4/gtk -I../subprojects/gtk4/gtk -Isubprojects/gtk4/gdk/x11 -I../subprojects/gtk4/gdk/x11 -Isubprojects/gtk4/gdk -I../subprojects/gtk4/gdk -Isubprojects/libpanel/src -I../subprojects/libpanel/src -Isubprojects/libpanel -I../subprojects/libpanel -I../subprojects/libcyaml/include -I../subprojects/yyjson/src -Isubprojects/yyjson -I../subprojects/yyjson -I../subprojects/magic_enum-0.9.5/include/magic_enum -Isubprojects/gtk4/gtk/css -Isubprojects/gtk4/gdk/version -Isubprojects/gtk4/gsk -Isubprojects/libbacktrace -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -I/usr/include/gio-unix-2.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/fribidi -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/graphene-1.0 -I/usr/lib/graphene-1.0/include -I/usr/include/libdrm -I/usr/include/lzo -I/usr/include/opus -I/usr/include/carla -I/usr/include/carla/includes -I/usr/include/gtksourceview-5 -I/usr/include/gtk-4.0 -I/usr/include/libxml2 -I/usr/include/zix-0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/home/alex/builds/DJsFEVGs9/0/zrythm/zrythm/build/subprojects/libbacktrace/dist/usr/local/include -flto=2 -fdiagnostics-color=always -fsanitize=address -fno-omit-frame-pointer -D_GLIBCXX_ASSERTIONS=1 -fpch-preprocess -include zrythm_pch.h -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu++17 -O2 -g -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_74 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_74 -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_14 -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_14 -Wformat=2 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-sequence-point -Wno-cast-function-type -frecord-gcc-switches -ffast-math -freciprocal-math -fsingle-precision-constant -mfpmath=sse -fno-omit-frame-pointer -fPIC -DMAGIC_ENUM_ENABLE_HASH -mfpmath=sse -msse -msse2 -pthread -D_REENTRANT -isystem/usr/include/graphene-1.0 -isystem/usr/lib/graphene-1.0/include -mfpmath=sse -msse -msse2 -isystem/usr/include/glib-2.0 -isystem/usr/lib/glib-2.0/include -isystem/usr/include/sysprof-6 -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -DG_LOG_USE_STRUCTURED=1 '-DG_LOG_DOMAIN="zrythm"' -DREALTIME= '-DOPTIMIZE(x)=__attribute__((optimize(#x)))' '-DOPTIMIZE_O0=OPTIMIZE(O0)' '-DOPTIMIZE_O1=OPTIMIZE(O1)' '-DOPTIMIZE_O2=OPTIMIZE(O2)' '-DOPTIMIZE_O3=OPTIMIZE(O3)' '-DNOINLINE=__attribute__((noinline))' '-DNONNULL_ARGS(...)=__attribute__((nonnull(__VA_ARGS__)))' '-DACCESS(...)=__attribute__((access(__VA_ARGS__)))' '-DACCESS_READ_ONLY(...)=ACCESS(read_only,__VA_ARGS__)' '-DGETTEXT_PACKAGE="zrythm"' '-DALWAYS_INLINE=__attribute__((always_inline))' '-DCOLD=__attribute__((cold))' '-DHOT=__attribute__((hot))' '-DPURE=__attribute__((pure))' '-DNONNULL=__attribute__((nonnull))' '-DRETURNS_NONNULL=__attribute__((returns_nonnull))' '-DSTACK_PROTECT=__attribute__((stack_protect))' '-DNO_STACK_PROTECTOR=__attribute__((no_stack_protector))' '-DWARN_UNUSED_RESULT=__attribute__((warn_unused_result))' '-DCONST=__attribute__((const))' '-DMALLOC=__attribute__((malloc))' -Wformat=2 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-sequence-point -Wno-cast-function-type -frecord-gcc-switches -ffast-math -DPIC -freciprocal-math -fsingle-precision-constant -mfpmath=sse -fno-omit-frame-pointer -Werror=alloca -Werror=format-overflow -Werror=format-truncation -Werror=clobbered -Werror=disabled-optimization -Werror=float-equal -Werror=logical-op -Werror=pointer-arith -Werror=enum-conversion -Werror=overlength-strings -Werror=stringop-truncation -Werror=missing-declarations -Werror=int-to-pointer-cast -Werror=shadow -Werror=address -Werror=undef -Werror=unused -fstrict-aliasing -Wstrict-aliasing=2 -Werror=strict-aliasing -Wstrict-overflow=2 -fstrict-overflow -Werror=duplicated-branches -Werror=duplicated-cond -Werror=null-dereference -Werror=init-self -Werror=write-strings -Werror=float-conversion -Werror=uninitialized -Werror=maybe-uninitialized -Werror=return-type -Werror=multistatement-macros -Werror=switch -Werror=overflow -Werror=enum-compare -Werror=misleading-indentation -Werror=int-in-bool-context -Werror=type-limits -Werror=endif-labels -Werror=logical-not-parentheses -Werror=parentheses -Werror=comment -Werror=sizeof-pointer-div -Werror=shift-count-overflow -Werror=free-nonheap-object -Werror=use-after-free -fanalyzer -Werror=analyzer-possible-null-dereference -Werror=analyzer-null-dereference -Werror=analyzer-null-argument -Werror=analyzer-use-after-free -Werror=analyzer-possible-null-argument -Werror=analyzer-double-free -Werror=analyzer-out-of-bounds -Werror=analyzer-deref-before-check -Werror=analyzer-allocation-size -Werror=analyzer-exposure-through-uninit-copy -Werror=analyzer-infinite-recursion -Werror=analyzer-jump-through-null -Werror=analyzer-fd-leak -Werror=nonnull -Werror=nonnull-compare -Werror=bool-compare -Werror=tautological-compare -Werror=unused-result -Werror=unused-variable -Werror=inline -Werror=redundant-decls -Werror=sizeof-array-argument -Werror=lto-type-mismatch -Werror=odr -Wsuggest-attribute=format -Wsuggest-attribute=cold -Werror=implicit-fallthrough -Werror=format=2 -MD -MQ src/libzrythm-lib.so.p/dsp_port_identifier.cpp.o -MF src/libzrythm-lib.so.p/dsp_port_identifier.cpp.o.d -o src/libzrythm-lib.so.p/dsp_port_identifier.cpp.o -c ../src/dsp/port_identifier.cpp
In file included from ../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_all.hpp:36,
                 from ../inc/utils/types.h:21,
                 from ../src/pch/zrythm_pch.h:10:
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp: In instantiation of ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::size_t) [with parent_t = magic_enum::containers::bitset<ZPortFlags>*; E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; std::size_t = long unsigned int]’:
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:645:32:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::reference magic_enum::containers::bitset<E, Index>::operator[](E) [with E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; reference = magic_enum::containers::bitset<ZPortFlags>::reference_impl<magic_enum::containers::bitset<ZPortFlags>*>]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:608:16:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::bitset(V) [with V = ZPortFlags; typename std::enable_if<(is_same_v<V, E> && (subtype_v<V> == magic_enum::detail::enum_subtype::flags)), int>::type <anonymous> = 0; E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>]’
../src/dsp/port_identifier.cpp:156:29:   required from here
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp: In instantiation of ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::size_t) [with parent_t = const magic_enum::containers::bitset<ZPortFlags>*; E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; std::size_t = long unsigned int]’:
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:650:32:   required from ‘constexpr bool magic_enum::containers::bitset<E, Index>::test(E) const [with E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:792:11:   required from ‘std::string magic_enum::containers::bitset<E, Index>::to_string(magic_enum::char_type) const [with E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; std::string = std::__cxx11::basic_string<char>; magic_enum::char_type = char]’
../src/dsp/port_identifier.cpp:156:29:   required from here
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<const magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<const magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<const magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp: In instantiation of ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::size_t) [with parent_t = magic_enum::containers::bitset<ZPortFlags2>*; E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; std::size_t = long unsigned int]’:
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:645:32:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::reference magic_enum::containers::bitset<E, Index>::operator[](E) [with E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; reference = magic_enum::containers::bitset<ZPortFlags2>::reference_impl<magic_enum::containers::bitset<ZPortFlags2>*>]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:608:16:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::bitset(V) [with V = ZPortFlags2; typename std::enable_if<(is_same_v<V, E> && (subtype_v<V> == magic_enum::detail::enum_subtype::flags)), int>::type <anonymous> = 0; E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>]’
../src/dsp/port_identifier.cpp:157:5:   required from here
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp: In instantiation of ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::size_t) [with parent_t = const magic_enum::containers::bitset<ZPortFlags2>*; E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; std::size_t = long unsigned int]’:
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:650:32:   required from ‘constexpr bool magic_enum::containers::bitset<E, Index>::test(E) const [with E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:792:11:   required from ‘std::string magic_enum::containers::bitset<E, Index>::to_string(magic_enum::char_type) const [with E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; std::string = std::__cxx11::basic_string<char>; magic_enum::char_type = char]’
../src/dsp/port_identifier.cpp:157:5:   required from here
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<const magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<const magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<const magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  504 |     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)}) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp: In instantiation of ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::pair<long unsigned int, typename std::conditional<(enum_count<E>() <= 8), unsigned char, typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type>::type>) [with parent_t = magic_enum::containers::bitset<ZPortFlags>*; E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; typename std::conditional<(enum_count<E>() <= 8), unsigned char, typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type>::type = unsigned int; typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type = unsigned int; typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type = unsigned int]’:
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:164:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::size_t) [with parent_t = magic_enum::containers::bitset<ZPortFlags>*; E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; std::size_t = long unsigned int]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:645:32:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::reference magic_enum::containers::bitset<E, Index>::operator[](E) [with E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; reference = magic_enum::containers::bitset<ZPortFlags>::reference_impl<magic_enum::containers::bitset<ZPortFlags>*>]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:608:16:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::bitset(V) [with V = ZPortFlags; typename std::enable_if<(is_same_v<V, E> && (subtype_v<V> == magic_enum::detail::enum_subtype::flags)), int>::type <anonymous> = 0; E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>]’
../src/dsp/port_identifier.cpp:156:29:   required from here
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp: In instantiation of ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::pair<long unsigned int, typename std::conditional<(enum_count<E>() <= 8), unsigned char, typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type>::type>) [with parent_t = const magic_enum::containers::bitset<ZPortFlags>*; E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; typename std::conditional<(enum_count<E>() <= 8), unsigned char, typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type>::type = unsigned int; typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type = unsigned int; typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type = unsigned int]’:
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:164:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::size_t) [with parent_t = const magic_enum::containers::bitset<ZPortFlags>*; E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; std::size_t = long unsigned int]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:650:32:   required from ‘constexpr bool magic_enum::containers::bitset<E, Index>::test(E) const [with E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:792:11:   required from ‘std::string magic_enum::containers::bitset<E, Index>::to_string(magic_enum::char_type) const [with E = ZPortFlags; Index = magic_enum::containers::detail::indexing<ZPortFlags, std::less<ZPortFlags>, void>; std::string = std::__cxx11::basic_string<char>; magic_enum::char_type = char]’
../src/dsp/port_identifier.cpp:156:29:   required from here
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<const magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<const magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags>::reference_impl<const magic_enum::containers::bitset<ZPortFlags>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp: In instantiation of ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::pair<long unsigned int, typename std::conditional<(enum_count<E>() <= 8), unsigned char, typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type>::type>) [with parent_t = magic_enum::containers::bitset<ZPortFlags2>*; E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; typename std::conditional<(enum_count<E>() <= 8), unsigned char, typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type>::type = unsigned int; typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type = unsigned int; typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type = unsigned int]’:
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:164:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::size_t) [with parent_t = magic_enum::containers::bitset<ZPortFlags2>*; E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; std::size_t = long unsigned int]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:645:32:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::reference magic_enum::containers::bitset<E, Index>::operator[](E) [with E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; reference = magic_enum::containers::bitset<ZPortFlags2>::reference_impl<magic_enum::containers::bitset<ZPortFlags2>*>]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:608:16:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::bitset(V) [with V = ZPortFlags2; typename std::enable_if<(is_same_v<V, E> && (subtype_v<V> == magic_enum::detail::enum_subtype::flags)), int>::type <anonymous> = 0; E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>]’
../src/dsp/port_identifier.cpp:157:5:   required from here
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp: In instantiation of ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::pair<long unsigned int, typename std::conditional<(enum_count<E>() <= 8), unsigned char, typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type>::type>) [with parent_t = const magic_enum::containers::bitset<ZPortFlags2>*; E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; typename std::conditional<(enum_count<E>() <= 8), unsigned char, typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type>::type = unsigned int; typename std::conditional<(enum_count<E>() <= 16), short unsigned int, typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type>::type = unsigned int; typename std::conditional<(enum_count<E>() <= 32), unsigned int, long unsigned int>::type = unsigned int]’:
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:504:164:   required from ‘constexpr magic_enum::containers::bitset<E, Index>::reference_impl<parent_t>::reference_impl(parent_t, std::size_t) [with parent_t = const magic_enum::containers::bitset<ZPortFlags2>*; E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; std::size_t = long unsigned int]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:650:32:   required from ‘constexpr bool magic_enum::containers::bitset<E, Index>::test(E) const [with E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>]’
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:792:11:   required from ‘std::string magic_enum::containers::bitset<E, Index>::to_string(magic_enum::char_type) const [with E = ZPortFlags2; Index = magic_enum::containers::detail::indexing<ZPortFlags2, std::less<ZPortFlags2>, void>; std::string = std::__cxx11::basic_string<char>; magic_enum::char_type = char]’
../src/dsp/port_identifier.cpp:157:5:   required from here
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<const magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<const magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:506:39: error: declaration of ‘parent’ shadows a member of ‘magic_enum::containers::bitset<ZPortFlags2>::reference_impl<const magic_enum::containers::bitset<ZPortFlags2>*>’ [-Werror=shadow]
  506 |     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)) {}
      |                              ~~~~~~~~~^~~~~~
../subprojects/magic_enum-0.9.5/include/magic_enum/magic_enum_containers.hpp:500:14: note: shadowed declaration is here
  500 |     parent_t parent;
      |              ^~~~~~
cc1plus: some warnings being treated as errors
alex-tee commented 6 months ago

Offending line: https://github.com/zrythm/zrythm/blob/4cd9919408759405743e9cf0d9f1bd085d31f430/src/dsp/port_identifier.cpp#L156

Macro definition: https://github.com/zrythm/zrythm/blob/4cd9919408759405743e9cf0d9f1bd085d31f430/inc/utils/types.h#L209

I also tried to make it ignore -Wshadow unsuccessfully... https://github.com/zrythm/zrythm/blob/4cd9919408759405743e9cf0d9f1bd085d31f430/inc/utils/types.h#L19

Neargye commented 6 months ago

fix in master