diff --git a/llvm/unittests/ADT/FunctionRefTest.cpp b/llvm/unittests/ADT/FunctionRefTest.cpp index b181933973037..6ad40406cdf38 100644 --- a/llvm/unittests/ADT/FunctionRefTest.cpp +++ b/llvm/unittests/ADT/FunctionRefTest.cpp @@ -60,11 +60,11 @@ TEST(FunctionRefTest, SFINAE) { } TEST(FunctionRefTest, Equality) { - function_ref X = [] { return 1; }; + const auto Lambda = []() { return 0; }; + function_ref X = Lambda; function_ref Y = X; EXPECT_EQ(X, Y); - const auto Lambda = []() { return 0; }; function_ref A(Lambda), B(Lambda); EXPECT_EQ(A, B); }