diff --git a/paddle/utils/array_ref_test.cc b/paddle/utils/array_ref_test.cc index cc4e88a5ee35196757a230ec92987b50adb2f96e..1c9087f1a891ae4d35f0e2c80d5b91ab14fc29da 100644 --- a/paddle/utils/array_ref_test.cc +++ b/paddle/utils/array_ref_test.cc @@ -78,7 +78,7 @@ TEST(array_ref, array_ref) { CHECK_EQ(drop.size(), size_t(1)); CHECK_EQ(drop[0], 3); - paddle::array_ref nums = {1, 2, 3, 4, 5, 6, 7, 8}; + static paddle::array_ref nums = {1, 2, 3, 4, 5, 6, 7, 8}; auto front = nums.take_front(3); CHECK_EQ(front.size(), size_t(3)); for (size_t i = 0; i < 3; ++i) {