diff --git a/llvm/unittests/BinaryFormat/MsgPackWriterTest.cpp b/llvm/unittests/BinaryFormat/MsgPackWriterTest.cpp index 3a5ba9af08f6c..dd8826ca6ccd5 100644 --- a/llvm/unittests/BinaryFormat/MsgPackWriterTest.cpp +++ b/llvm/unittests/BinaryFormat/MsgPackWriterTest.cpp @@ -40,7 +40,7 @@ TEST_F(MsgPackWriter, TestWriteFixPositiveInt) { MPWriter.write(u); std::string Output = OStream.str(); EXPECT_EQ(Output.size(), 1u); - EXPECT_EQ(Output.data()[0], static_cast(u)); + EXPECT_EQ(Output[0], static_cast(u)); } } @@ -128,7 +128,7 @@ TEST_F(MsgPackWriter, TestWriteFixNegativeInt) { MPWriter.write(i); std::string Output = OStream.str(); EXPECT_EQ(Output.size(), 1u); - EXPECT_EQ(static_cast(Output.data()[0]), static_cast(i)); + EXPECT_EQ(static_cast(Output[0]), static_cast(i)); } }