From 31659fa066b00afeea38d36ba87b531a4d7313d7 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Mon, 14 Jan 2013 21:23:37 +0000 Subject: [PATCH] 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 --- unittests/IR/WaymarkTest.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/unittests/IR/WaymarkTest.cpp b/unittests/IR/WaymarkTest.cpp index 1e9807554cc..0fe0a431b28 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(const_cast(Ue + 1)), - U->getUser()); + EXPECT_EQ(reinterpret_cast(Ue + 1), U->getUser()); } }