I have a requirement to do static analysis on my header-only C++ template library.
It is normally exercised by a set of unit tests, but I require the static analysis results to only show issues with the header template code. Is this possible? Or can cppcheck just analyse the header files only, without requiring code to instantiate the templates?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for late reply. It is possible but I would recommend that you use Cppcheck on properly instantiated code also. having some proper values and types etc to reason about should help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a requirement to do static analysis on my header-only C++ template library.
It is normally exercised by a set of unit tests, but I require the static analysis results to only show issues with the header template code. Is this possible? Or can cppcheck just analyse the header files only, without requiring code to instantiate the templates?
Sorry for late reply. It is possible but I would recommend that you use Cppcheck on properly instantiated code also. having some proper values and types etc to reason about should help.