llvm.org GIT mirror llvm / f1fd228
Fix const ilist_node::get{Prev,Next}Node() to actually compile. Picky, picky. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103723 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 10 years ago
2 changed file(s) with 7 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
6666
6767 /// \brief Get the previous node, or 0 for the list head.
6868 const NodeTy *getPrevNode() const {
69 NodeTy *Prev = this->getPrev();
69 const NodeTy *Prev = this->getPrev();
7070
7171 // Check for sentinel.
7272 if (!Prev->getNext())
8888
8989 /// \brief Get the next node, or 0 for the list tail.
9090 const NodeTy *getNextNode() const {
91 NodeTy *Next = getNext();
91 const NodeTy *Next = getNext();
9292
9393 // Check for sentinel.
9494 if (!Next->getNext())
3333 EXPECT_EQ(2, List.back().Value);
3434 EXPECT_EQ(2, List.front().getNextNode()->Value);
3535 EXPECT_EQ(1, List.back().getPrevNode()->Value);
36
37 const ilist &ConstList = List;
38 EXPECT_EQ(2, ConstList.back().Value);
39 EXPECT_EQ(2, ConstList.front().getNextNode()->Value);
40 EXPECT_EQ(1, ConstList.back().getPrevNode()->Value);
3641 }
3742
3843 }