git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103723
91177308-0d34-0410-b5e6-
96231b3b80d8
/// \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())
/// \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())
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);
}
}