A stronger version of S5277: if a function return value was assigned to a variable, that variable must be used later on.
Detect whether the return value reaches some "sink" - assigned to a member, global, or static variable; returned from a function, stored to a reference or pointer, affected the control flow.
Do not report cases of a function return value ignored from the beginning (e.g., set.insert( x );. Report cases when the value is assigned to a variable, and that variable then has no effect on the further execution.
Also, see S6007 as another heuristic for a function which value should not be discarded.