From 5702b4de268122756a09bcfb4df4089ca77d7187 Mon Sep 17 00:00:00 2001 From: risemeup1 <62429225+risemeup1@users.noreply.github.com> Date: Mon, 3 Apr 2023 11:17:47 +0800 Subject: [PATCH] fix gcc12_error (#52441) --- paddle/utils/array_ref_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/utils/array_ref_test.cc b/paddle/utils/array_ref_test.cc index cc4e88a5ee3..1c9087f1a89 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) { -- GitLab