diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-14 21:23:37 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-14 21:23:37 +0000 |
commit | 31659fa066b00afeea38d36ba87b531a4d7313d7 (patch) | |
tree | 2794bdfdd56767d86c5c7661787409f280b6afcc | |
parent | 398db9368d72d1d60d40b2e18c16ca2c14aa7f39 (diff) |
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
-rw-r--r-- | unittests/IR/WaymarkTest.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/unittests/IR/WaymarkTest.cpp b/unittests/IR/WaymarkTest.cpp index 1e9807554c..0fe0a431b2 100644 --- a/unittests/IR/WaymarkTest.cpp +++ b/unittests/IR/WaymarkTest.cpp @@ -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()); } } |