Cppcheck false positive? (eg 'PropEntry::operator=' should return 'PropEntry &')

David Tardon dtardon at redhat.com
Sat Dec 29 03:03:06 PST 2012


On Thu, Dec 27, 2012 at 01:12:27PM -0800, julien2412 wrote:
> Thank you Lubos for the reference.
> So I won't change these since it could generate some regressions if badly
> done.
> About first report, I meant that = operator is a priori for assignment not
> for comparison. So even if the one who did this, did it right (and I suppose
> it's the case), it could be a little confusing (and so a little dangerous).
> Now perhaps it's confusing only for me and then, sorry for the noise :-)

The comment in lingucomponent/source/languageguessing/simpleguesser.hxx
lies. It is assignment. But the signature should be changed to

SimpleGuesser& operator=(const SimpleGuesser& other);

and its impl. should guard against self-assignment.


More information about the LibreOffice mailing list