SingleLinkedListIterator::operator++(int) shouldn't return a reference

The returned reference is to a local object.  Instead, make a copy.

Found by PVS-Studio.

llvm-svn: 285603
This commit is contained in:
David Majnemer 2016-10-31 17:20:43 +00:00
parent 3aa049102f
commit 8a92dcc53b
1 changed files with 1 additions and 1 deletions

View File

@ -672,7 +672,7 @@ namespace llvm {
P = P->Next;
return *this;
}
SingleLinkedListIterator<T> &operator++(int) {
SingleLinkedListIterator<T> operator++(int) {
SingleLinkedListIterator res = *this;
++*this;
return res;