jk-jeon/dragonbox

MSVC: warning C4702: unreachable code

seanmiddleditch opened this issue · 0 comments

The following error arises when compiling with MSVC (17.5.0 Preview 2.0) with /W4:

...\dragonbox-src\include\dragonbox\dragonbox.h(662): warning C4702: unreachable code

The line in for the warning is:

constexpr auto divisor = compute_power<N>(UInt(10));

However, that isn't the real problem. The warning is actually triggered by the whole second if constexpr block at:

if constexpr (std::is_same_v<UInt, std::uint64_t> && N == 3 &&

Changing that second if constexpr to else if constexpr resolves the warning.