Skip to content

Commit c6c1948

Browse files
author
Your Name
committed
Set default values
1 parent 7953636 commit c6c1948

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

lib/settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ class CPPCHECKLIB WARN_UNUSED Settings {
469469
/** @brief Is --template-full-rebuild given? Recreate the symbol database etc. from
470470
* scratch after each template type deduction round instead of updating them
471471
* incrementally. For testing and debugging. */
472-
bool templateFullRebuild{};
472+
bool templateFullRebuild = false;
473473

474474
/** @brief The output format in which the error locations are printed in
475475
* text mode, e.g. "{file}:{line} {info}" */

lib/templatesimplifier.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -800,21 +800,21 @@ namespace {
800800
// A function template parameter with a form that is supported by type deduction:
801801
// "T", "T &", "const T &", "T *", "const T *" or a concrete single token type
802802
struct ParameterShape {
803-
const Token* typeTok{};
803+
const Token* typeTok = nullptr;
804804
int templateParameterIndex = -1; // -1 => a concrete type, nothing is deduced
805-
bool isConst{};
806-
bool isPointer{};
807-
bool isReference{};
805+
bool isConst = false;
806+
bool isPointer = false;
807+
bool isReference = false;
808808
};
809809

810810
// The type deduced for a template parameter from a function call argument
811811
struct DeducedType {
812812
std::string typeStr; // base type, e.g. "int" or "MyClass"
813813
std::vector<std::string> qualification; // enclosing scopes for record types, outermost first
814-
unsigned int constness{}; // bit 0 = data const, bit 1 = first '*' const, ..
815-
int pointer{}; // number of '*'
816-
bool isUnsigned{};
817-
bool isLong{};
814+
unsigned int constness = 0; // bit 0 = data const, bit 1 = first '*' const, ..
815+
int pointer = 0; // number of '*'
816+
bool isUnsigned = false;
817+
bool isLong = false;
818818

819819
bool operator==(const DeducedType& other) const {
820820
return typeStr == other.typeStr &&

lib/templatesimplifier.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,11 @@ class CPPCHECKLIB TemplateSimplifier {
609609
ErrorLogger &mErrorLogger;
610610
bool mChanged{};
611611
/** true when type information (AST, SymbolDatabase, ValueType) is available for deduction */
612-
bool mUseTypeInformation{};
612+
bool mUseTypeInformation = false;
613613
/** true when there are calls where deduction may succeed once type information is available */
614-
bool mPendingTypeDeductions{};
614+
bool mPendingTypeDeductions = false;
615615
/** true when the current simplifyTemplatesUsingTypeInformation() call deduced something */
616-
bool mTypeDeductionsMade{};
616+
bool mTypeDeductionsMade = false;
617617
/** names of all expanded instantiations; persists between simplifyTemplates() calls so a
618618
* later deduced instantiation reuses the existing expansion instead of duplicating it */
619619
std::set<std::string> mExpandedTemplateNames;

0 commit comments

Comments
 (0)