summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/unittests/ADT/SmallVectorTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/unittests/ADT/SmallVectorTest.cpp')
-rw-r--r--gnu/llvm/unittests/ADT/SmallVectorTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/gnu/llvm/unittests/ADT/SmallVectorTest.cpp b/gnu/llvm/unittests/ADT/SmallVectorTest.cpp
index 46f7021ac16..7367ad470e3 100644
--- a/gnu/llvm/unittests/ADT/SmallVectorTest.cpp
+++ b/gnu/llvm/unittests/ADT/SmallVectorTest.cpp
@@ -459,7 +459,8 @@ TYPED_TEST(SmallVectorTest, EraseTest) {
SCOPED_TRACE("EraseTest");
this->makeSequence(this->theVector, 1, 3);
- this->theVector.erase(this->theVector.begin());
+ const auto &theConstVector = this->theVector;
+ this->theVector.erase(theConstVector.begin());
this->assertValuesInOrder(this->theVector, 2u, 2, 3);
}
@@ -468,7 +469,8 @@ TYPED_TEST(SmallVectorTest, EraseRangeTest) {
SCOPED_TRACE("EraseRangeTest");
this->makeSequence(this->theVector, 1, 3);
- this->theVector.erase(this->theVector.begin(), this->theVector.begin() + 2);
+ const auto &theConstVector = this->theVector;
+ this->theVector.erase(theConstVector.begin(), theConstVector.begin() + 2);
this->assertValuesInOrder(this->theVector, 1u, 3);
}