Fix failing test builds with -Werror=maybe-uninitialized on gcc

Apparently the added constexpr makes gcc's control flow analysis to go deeper.

If from_chars returns with error then the out parameter remains
uninitialized. As it's undefined behavior to use its value, it's better
to just skip the rest of the loop in this case.
This commit is contained in:
Lenard Szolnoki 2023-03-04 17:23:20 +00:00
parent e4d4e43b21
commit 58798ee81f
2 changed files with 2 additions and 0 deletions

View File

@ -62,6 +62,7 @@ void random_values(size_t N) {
if (errors > 10) {
abort();
}
continue;
}
if (std::isnan(v)) {
if (!std::isnan(result_value)) {

View File

@ -65,6 +65,7 @@ void random_values(size_t N) {
if (errors > 10) {
abort();
}
continue;
}
if (std::isnan(v)) {
if (!std::isnan(result_value)) {