1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

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 064168a303
commit af41691053

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;