diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp index 093b3a26b5f87..e121bae8b4481 100644 --- a/llvm/unittests/ProfileData/MemProfTest.cpp +++ b/llvm/unittests/ProfileData/MemProfTest.cpp @@ -747,7 +747,7 @@ TEST(MemProf, YAMLParser) { // Verify the entire contents of MemProfData.Records. ASSERT_THAT(MemProfData.Records, SizeIs(1)); - const auto &[GUID, Record] = *MemProfData.Records.begin(); + const auto &[GUID, Record] = MemProfData.Records.front(); EXPECT_EQ(GUID, 0xdeadbeef12345678ULL); ASSERT_THAT(Record.AllocSites, SizeIs(2)); EXPECT_EQ(Record.AllocSites[0].CSId, hashCallStack(CS1));