1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Fix const ilist_node::get{Prev,Next}Node() to actually compile. Picky, picky.

llvm-svn: 103723
This commit is contained in:
Daniel Dunbar 2010-05-13 18:35:02 +00:00
parent ed8dd53c85
commit 10ef3afee3
2 changed files with 7 additions and 2 deletions

View File

@ -67,7 +67,7 @@ public:
/// \brief Get the previous node, or 0 for the list head.
const NodeTy *getPrevNode() const {
NodeTy *Prev = this->getPrev();
const NodeTy *Prev = this->getPrev();
// Check for sentinel.
if (!Prev->getNext())
@ -89,7 +89,7 @@ public:
/// \brief Get the next node, or 0 for the list tail.
const NodeTy *getNextNode() const {
NodeTy *Next = getNext();
const NodeTy *Next = getNext();
// Check for sentinel.
if (!Next->getNext())

View File

@ -34,6 +34,11 @@ TEST(ilistTest, Basic) {
EXPECT_EQ(2, List.back().Value);
EXPECT_EQ(2, List.front().getNextNode()->Value);
EXPECT_EQ(1, List.back().getPrevNode()->Value);
const ilist<Node> &ConstList = List;
EXPECT_EQ(2, ConstList.back().Value);
EXPECT_EQ(2, ConstList.front().getNextNode()->Value);
EXPECT_EQ(1, ConstList.back().getPrevNode()->Value);
}
}