eggs-cpp / variant

Eggs.Variant is a C++11/14/17 generic, type-safe, discriminated union.
http://eggs-cpp.github.io/variant/
Boost Software License 1.0
137 stars 27 forks source link

Failure with MSVC2017's /permissive- switch #28

Closed jcelerier closed 6 years ago

jcelerier commented 6 years ago

Getting a lot of these (everything works in "permissive" mode and in other compilers):

variant/variant.hpp(127): error C2371: 'eggs::variants::detail::_best_match::overloads<eggs::variants::detail::pack<Ts...>,eggs::variants::
detail::pack_c<::size_t,Is...>>::fun_ptr': redefinition; different basic types
variant/variant.hpp(127): note: see declaration of 'eggs::variants::detail::_best_match::overloads<eggs::variants::detail::pack<Ts...>,eg
  gs::variants::detail::pack_c<::size_t,Is...>>::fun_ptr'
variant/variant.hpp(129): note: see reference to class template instantiation 'eggs::variants::detail::_best_match::overloads<eggs::varia
  nts::detail::pack<Ts...>,eggs::variants::detail::pack_c<::size_t,Is...>>' being compiled
variant/variant.hpp(149): error C2371: 'eggs::variants::detail::_best_match::explicit_overloads<eggs::variants::detail::pack<Ts...>,U,eggs:
:variants::detail::pack_c<::size_t,Is...>>::fun_ptr': redefinition; different basic types
variant/variant.hpp(149): note: see declaration of 'eggs::variants::detail::_best_match::explicit_overloads<eggs::variants::detail::pack<
  Ts...>,U,eggs::variants::detail::pack_c<::size_t,Is...>>::fun_ptr'
 variant/variant.hpp(151): note: see reference to class template instantiation 'eggs::variants::detail::_best_match::explicit_overloads<eg
  gs::variants::detail::pack<Ts...>,U,eggs::variants::detail::pack_c<::size_t,Is...>>' being compiled
K-ballo commented 6 years ago

I am able to reproduce with MSVC19.12. It looks like a regression on their part, will investigate.

K-ballo commented 6 years ago

It does not happen if using typedef _fallback(*fun_ptr)(...); instead of using fun_ptr = _fallback(*)(...);.

K-ballo commented 6 years ago

Pushed e66ddfbbbeac54815a6b055122e9af78259986b9 with workaround to develop branch.