Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .selfcheck_suppressions
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ autoNoType:test/*.cpp
autoNoType:tools/triage/mainwindow.cpp
# ticket 11631
templateInstantiation:test/testutils.cpp
# the "calculate<T, T>(...)" call in the 1-arg overload cannot be instantiated by the template simplifier
templateInstantiation:lib/calculate.h
# used in a member initializer - the check does not see usage there
unusedPrivateFunction:test/testsimplifytemplate.cpp

naming-varname:externals/simplecpp/simplecpp.h
naming-privateMemberVariable:externals/simplecpp/simplecpp.h
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ $(libcppdir)/summaries.o: lib/summaries.cpp lib/analyzerinfo.h lib/checkers.h li
$(libcppdir)/suppressions.o: lib/suppressions.cpp externals/tinyxml2/tinyxml2.h lib/addoninfo.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/vfvalue.h lib/xml.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/suppressions.cpp

$(libcppdir)/templatesimplifier.o: lib/templatesimplifier.cpp lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(libcppdir)/templatesimplifier.o: lib/templatesimplifier.cpp lib/astutils.h lib/checkers.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(libcppdir)/templatesimplifier.cpp

$(libcppdir)/timer.o: lib/timer.cpp lib/config.h lib/timer.h
Expand Down Expand Up @@ -924,7 +924,7 @@ test/testthreadexecutor.o: test/testthreadexecutor.cpp cli/executor.h cli/thread
test/testtimer.o: test/testtimer.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/timer.h lib/utils.h test/fixture.h test/redirect.h
$(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtimer.cpp

test/testtoken.o: test/testtoken.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
test/testtoken.o: test/testtoken.cpp lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/smallvector.h lib/sourcelocation.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
$(CXX) ${INCLUDE_FOR_TEST} ${CFLAGS_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testtoken.cpp

test/testtokenize.o: test/testtokenize.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkers.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/smallvector.h lib/standards.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
Expand Down
5 changes: 5 additions & 0 deletions cli/cmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,11 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
// TODO: bail out when no placeholders are found?
}

// Recreate the symbol database etc. after each template type deduction round
// instead of updating them incrementally - for testing and debugging
else if (std::strcmp(argv[i], "--template-full-rebuild") == 0)
mSettings.templateFullRebuild = true;

else if (std::strncmp(argv[i], "--template-location=", 20) == 0) {
mSettings.templateLocation = argv[i] + 20;
// TODO: bail out when no template is provided?
Expand Down
5 changes: 5 additions & 0 deletions lib/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,11 @@ class CPPCHECKLIB WARN_UNUSED Settings {
e.g. "{severity} {file}:{line} {message} {id}" */
std::string templateFormat;

/** @brief Is --template-full-rebuild given? Recreate the symbol database etc. from
* scratch after each template type deduction round instead of updating them
* incrementally. For testing and debugging. */
bool templateFullRebuild = false;

/** @brief The output format in which the error locations are printed in
* text mode, e.g. "{file}:{line} {info}" */
std::string templateLocation;
Expand Down
Loading
Loading