Skip to content

Commit 92574b5

Browse files
authored
Fix a dangling reference in FunctionRefTest.cpp (#114949)
1 parent d0bbe4f commit 92574b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/unittests/ADT/FunctionRefTest.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ TEST(FunctionRefTest, SFINAE) {
6060
}
6161

6262
TEST(FunctionRefTest, Equality) {
63-
function_ref<int()> X = [] { return 1; };
63+
const auto Lambda = []() { return 0; };
64+
function_ref<int()> X = Lambda;
6465
function_ref<int()> Y = X;
6566
EXPECT_EQ(X, Y);
6667

67-
const auto Lambda = []() { return 0; };
6868
function_ref<int()> A(Lambda), B(Lambda);
6969
EXPECT_EQ(A, B);
7070
}

0 commit comments

Comments
 (0)