Avoid use of constructor functions for side-effects
Some people like to call constructor functions without assigning its result to any variable:
There is no advantage in this approach over simply calling MyConstructor since the object that the operator new creates isn't used anywhere. So such kind of syntax is misleading and should be avoided.
- Violation message
Replace the statement by a standard call to the MyConstructor() function
- Default severity
Part of Sonar war quality profile