Skip to content

Commit adabc58

Browse files
hjmjohnsonclaude
andcommitted
COMP: Initialize convergenceValue to suppress uninitialized warning
Value-initialize convergenceValue with {} so it has a defined value if GetConvergenceValue() throws and the assignment is skipped. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 079d40b commit adabc58

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/Numerics/Optimizersv4/test/itkWindowConvergenceMonitoringFunctionGTest.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ TEST(WindowConvergenceMonitoringFunction, ConvertedLegacyTest)
3131
for (RealType x = 0.0; x < 20; x += 1.0)
3232
{
3333
convergenceMonitoring->AddEnergyValue(std::pow(static_cast<RealType>(2.0), -x));
34-
RealType convergenceValue;
34+
RealType convergenceValue{};
3535
EXPECT_NO_THROW(convergenceValue = convergenceMonitoring->GetConvergenceValue());
3636
std::cout << "convergence value: " << convergenceValue << std::endl;
3737
}

0 commit comments

Comments
 (0)