Hacker News new | ask | show | jobs
by Rubberducky1324 290 days ago
clang-tidy can often detect these. If the body of the function doesn't modify the value, for example.

But it needs to be conservative of course, in general you can't do this.