Examples of errors detected by the V558 diagnostic
V558. Function returns pointer/reference to temporary local object.
SeqAn
V558 Function returns the reference to temporary local object: before. iter_concat_virtual.h 277
template <typename TStringSet, typename TSpec>
inline Iter<TStringSet, ConcatVirtual<TSpec> > const &
operator++(Iter<TStringSet, ConcatVirtual<TSpec> > & me, int)
{
Iter<TStringSet, ConcatVirtual<TSpec> > before = me;
goNext(me);
return before;
}
Similar errors can be found in some other places:
- V558 Function returns the reference to temporary local object: before. iter_concat_virtual.h 310
VirtualDub
V558 Function returns the reference to temporary local object: tmp. VirtualDub vdstl.h 460
vdlist_iterator& operator--(int) {
vdlist_iterator tmp(*this);
mp = mp->mListNodePrev;
return tmp;
}
Geant4 software
V558 Function returns the reference to temporary local object: rprim. G4GMocren g4gmocrenio.cc 131
template <typename T> GMocrenDataPrimitive<T> &
GMocrenDataPrimitive<T>::operator + (
const GMocrenDataPrimitive<T> & _right)
{
GMocrenDataPrimitive<T> rprim;
....
return rprim;
}
LLVM/Clang
V558 Function returns the reference to temporary local object: res. LiveInterval.h 679
SingleLinkedListIterator<T> &operator++(int) {
SingleLinkedListIterator res = *this;
++*this;
return res;
}
EFL Core Libraries
V558 Function returns the reference to temporary local object: tmp. eina_accessor.hh 519
accessor_iterator<T>& operator++(int)
{
accessor_iterator<T> tmp(*this);
++*this;
return tmp;
}
Similar errors can be found in some other places:
- V558 Function returns the reference to temporary local object: tmp. eina_accessor.hh 535
- V558 Function returns the reference to temporary local object: tmp. eina_accessor.hh 678
- V558 Function returns the reference to temporary local object: tmp. eina_accessor.hh 694
Android
V558 CWE-562 Function returns the reference to temporary local object: tmp. transform_iterator.h 77
TransformIterator& operator++(int) {
TransformIterator tmp(*this);
++*this;
return tmp;
}
Android
V558 CWE-562 Function returns the reference to temporary local object: tmp. transform_iterator.h 92
TransformIterator& operator--(int) {
TransformIterator tmp(*this);
--*this;
return tmp;
}