Skip to content

Commit

Permalink
Work around GCC false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Sep 11, 2024
1 parent e9e7ad7 commit b5cbdfa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/base/reportbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4636,7 +4636,9 @@ namespace Wisteria
std::nullopt;
if (position.has_value() && doubleStartOffset.has_value())
{
position = position.value_or(0) + doubleStartOffset.value();
// value() should work here, but GCC throws an
// 'uninitialized value' false positive warning
position = position.value_or(0) + doubleStartOffset.value_or(0);
}

return position;
Expand Down

0 comments on commit b5cbdfa

Please sign in to comment.