Skip to content

Commit

Permalink
COMP: Fix initializer list lifetime warning
Browse files Browse the repository at this point in the history
Fix initializer list lifetime warning.

Fixes:
```
Modules/Remote/Montage/test/itkMontageTestHelper.hxx:248:28: warning:
assignment from temporary initializer_list does not extend the lifetime of the underlying array [-Winit-list-lifetime]
248 |       interpolationMethods = { static_cast<PeakInterpolationType>(peakMethodNumber) };
    |       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

raised at:
https://open.cdash.org/viewBuildError.php?type=1&buildid=7491724
  • Loading branch information
jhlegarreta authored and dzenanz committed Oct 5, 2021
1 parent e2039b9 commit 2fd431a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/itkMontageTestHelper.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ montageTest(const itk::TileConfiguration<Dimension> & stageTiles,
if (peakMethodToUse >= 0)
{
auto peakMethodNumber = static_cast<PeakMethodUnderlying>(peakMethodToUse);
interpolationMethods = { static_cast<PeakInterpolationType>(peakMethodNumber) };
std::initializer_list<itk::PhaseCorrelationOptimizerEnums::PeakInterpolationMethod> interpMethods = {
static_cast<PeakInterpolationType>(peakMethodNumber)
};
interpolationMethods = interpMethods;
}
for (auto peakMethod : interpolationMethods)
{
Expand Down

0 comments on commit 2fd431a

Please sign in to comment.