Closed garyfurnish closed 11 months ago
Closing/reopening to retrigger CI.
Since BOOST_ASSERT disappears in release builds, this change results in a "not all control paths return a value" warning.
Since BOOST_ASSERT disappears in release builds, this change results in a "not all control paths return a value" warning.
This should be the case for the current code as well, because it relies on BOOST_ASSERT in these two cases:
case object:
default:
BOOST_ASSERT(false); // must start with string, i.e. call new_value
It's not, as the CI results show. The code just falls through to the next case
.
This PR can probably be fixed to be warning-free by adding BOOST_UNREACHABLE_RETURN(root)
at the end.
On clang with -Wcovered-switch-default this fixes the following error:
/mnt/fscratch0/pub/dependencies/boost/boost/property_tree/json_parser/detail/standard_callbacks.hpp:130:6: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default] default:
Essentially default is unnecessary and may prevent detection of future bugs by allowing catching future added enums. This moves the Assert to the bottom of the function where it theoretically is dead code as the enum is fully covered by returns.