Why is "unused variable" warning not reported for all variables?<>
This question already has an answer here:
- g++ does not show a 'unused' warning 3 answers
It is not a primitive value, so its constructor and/or destructor might have desired side effects.
Classical example: a Timer object which measures the time between its construction and destruction: https://stackoverflow.com/a/5302868/1938163