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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172474 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dmitri Gribenko 2013-01-14 21:23:37 +00:00
parent 398db9368d
commit 31659fa066

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());
}
}