This PR provides a workaround around a compiler bug, which seems to have appeared in VS 2022. It appears that the bug is only triggered with /permissive-, which is enabled by default when using /std:c++20. As I was unable to make CMAKE set the former, I simply set the latter in the accompanying CI tests.
In this version of the PR, the workaround is hidden behind a FOONATHAN_SFINAE_WORKAROUND guard, which for now is implemented unconditionally, as I haven't fully determined what versions and compiler flag combinations really trigger the issue. Since you have used std::declval in other places within FOONATHAN_SFINAE, maybe the workaround could actually be used unconditionally everywhere, and the guard removed? Let me know.
This PR provides a workaround around a compiler bug, which seems to have appeared in VS 2022. It appears that the bug is only triggered with
/permissive-
, which is enabled by default when using/std:c++20
. As I was unable to make CMAKE set the former, I simply set the latter in the accompanying CI tests.In this version of the PR, the workaround is hidden behind a
FOONATHAN_SFINAE_WORKAROUND
guard, which for now is implemented unconditionally, as I haven't fully determined what versions and compiler flag combinations really trigger the issue. Since you have usedstd::declval
in other places withinFOONATHAN_SFINAE
, maybe the workaround could actually be used unconditionally everywhere, and the guard removed? Let me know.