diff --git a/hardware_interface/test/test_macros.cpp b/hardware_interface/test/test_macros.cpp index c32497c6b1..db62bce38f 100644 --- a/hardware_interface/test/test_macros.cpp +++ b/hardware_interface/test/test_macros.cpp @@ -62,7 +62,7 @@ TEST_F(TestMacros, throw_on_not_null) EXPECT_ANY_THROW(THROW_ON_NOT_NULLPTR(a_ptr)); std::vector vec_ptr; - for (size_t i : {0, 1, 2}) + for (size_t i = 0; i < 3; ++i) { vec_ptr.push_back(i_ptr); EXPECT_ANY_THROW(THROW_ON_NOT_NULLPTR(vec_ptr[i]));