Skip to content

Commit cc69d1c

Browse files
committed
COMP: Fix linux compilation warning
Modules/Core/Common/test/itkImageBufferRangeGTest.cxx: In lambda function: Modules/Core/Common/test/itkImageBufferRangeGTest.cxx:670:61: warning: declaration of 'n' shadows a previous local [-Wshadow] 670 | const auto expectedResult = [&r](const difference_type n) { | ^ Modules/Core/Common/test/itkImageBufferRangeGTest.cxx:667:31: note: shadowed declaration is here 667 | constexpr difference_type n = 3; | ^ Modules/Core/Common/test/itkImageBufferRangeGTest.cxx: In lambda function:
1 parent f17aa08 commit cc69d1c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Modules/Core/Common/test/itkImageBufferRangeGTest.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,9 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess)
667667
constexpr difference_type n = 3;
668668

669669
r = initialIterator;
670-
const auto expectedResult = [&r](const difference_type n) {
670+
const auto expectedResult = [&r](const difference_type nn) {
671671
// Operational semantics, as specified by the C++11 Standard:
672-
difference_type m = n;
672+
difference_type m = nn;
673673
if (m >= 0)
674674
while (m--)
675675
++r;
@@ -690,10 +690,10 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess)
690690
static_assert(std::is_same_v<decltype(a + n), X>, "Return type tested");
691691
static_assert(std::is_same_v<decltype(n + a), X>, "Return type tested");
692692

693-
const auto expectedResult = [a](const difference_type n) {
693+
const auto expectedResult = [a](const difference_type nn) {
694694
// Operational semantics, as specified by the C++11 Standard:
695695
X tmp = a;
696-
return tmp += n;
696+
return tmp += nn;
697697
}(n);
698698

699699
EXPECT_EQ(a + n, expectedResult);
@@ -704,9 +704,9 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess)
704704
constexpr difference_type n = 3;
705705

706706
r = initialIterator;
707-
const auto expectedResult = [&r](const difference_type n) {
707+
const auto expectedResult = [&r](const difference_type nn) {
708708
// Operational semantics, as specified by the C++11 Standard:
709-
return r += -n;
709+
return r += -nn;
710710
}(n);
711711
r = initialIterator;
712712
auto && actualResult = r -= n;
@@ -719,10 +719,10 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess)
719719

720720
static_assert(std::is_same_v<decltype(a - n), X>, "Return type tested");
721721

722-
const auto expectedResult = [a](const difference_type n) {
722+
const auto expectedResult = [a](const difference_type nn) {
723723
// Operational semantics, as specified by the C++11 Standard:
724724
X tmp = a;
725-
return tmp -= n;
725+
return tmp -= nn;
726726
}(n);
727727

728728
EXPECT_EQ(a - n, expectedResult);

0 commit comments

Comments
 (0)