You’ll want to use a static analysis tool
- StackOverflow: What open source C++ static analysis tools are available?
- Wikipedia: List of tools for static code analysis
The main gotcha I’ve run into is that you have to be careful that any libraries aren’t used from somewhere that you don’t control/have. If you delete a function from a class that gets used by referencing a library in your project you can break something that you didn’t know used the code.