1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

Improve r172464: const_cast is not needed if the variable is not const

llvm-svn: 172474
This commit is contained in:
Dmitri Gribenko 2013-01-14 21:23:37 +00:00
parent 508f7bf868
commit 521181bcca

View File

@ -44,10 +44,9 @@ TEST(WaymarkTest, TwoBit) {
Use* many = (Use*)calloc(sizeof(Use), 8212 + 1);
ASSERT_TRUE(many);
Use::initTags(many, many + 8212);
for (const Use *U = many, *Ue = many + 8212 - 1; U != Ue; ++U)
for (Use *U = many, *Ue = many + 8212 - 1; U != Ue; ++U)
{
EXPECT_EQ(reinterpret_cast<User*>(const_cast<Use *>(Ue + 1)),
U->getUser());
EXPECT_EQ(reinterpret_cast<User *>(Ue + 1), U->getUser());
}
}