Attached patch is a partial fix for PR19102. The idea is to assume the unused operator new as not a leak if the following requirement is met:
- The invoked constructor has a parameter - pointer or reference to a record that has a public method (any access level , if a constructed record is a friend of a parameter record), that accepts a pointer to the type of the constructed record or one of its bases.
The analysis can be much more precise if the analyzer can analyze the body of the constructor, but for now the criteria above can be used regardless of whether the body of the constructor is accessible to the analyzer or not.
Please review.
Style nitpick: * next to the variable name.