Qt-DetachingTemporary

Calling non-const member functions on temporaries should be avoided

Required inputs: IR

Finds places where you are calling non-const member functions on temporaries. For example getList().first(), which would detach if the container is shared.

This rule is based on clazy rule detaching-temporary

Possible Messages

Key

Text

Severity

Disabled

detaching-temporary

Calling {} on a temporary detaches

None

False

modifying-temporary

Modifying temporary containers is pointless and also detaches

None

False

Options

level

level : int = 1

Importance level of the rule as given for clazy. 0 is most desirable, higher values fall off in quality.