clang-tidy: address modernize-use-default-member-init lints

This commit is contained in:
Ben Boeckel 2022-05-17 12:49:23 -04:00 committed by Brad King
parent 437789db07
commit a5f8cbe8b1
54 changed files with 109 additions and 212 deletions

View File

@ -116,13 +116,12 @@ public:
cmCPackeIFWUpdatesPatcher(cmCPackIFWRepository* r, cmXMLWriter& x) cmCPackeIFWUpdatesPatcher(cmCPackIFWRepository* r, cmXMLWriter& x)
: repository(r) : repository(r)
, xout(x) , xout(x)
, patched(false)
{ {
} }
cmCPackIFWRepository* repository; cmCPackIFWRepository* repository;
cmXMLWriter& xout; cmXMLWriter& xout;
bool patched; bool patched = false;
protected: protected:
void StartElement(const std::string& name, const char** atts) override void StartElement(const std::string& name, const char** atts) override

View File

@ -88,7 +88,6 @@ class cmCTestBZR::InfoParser : public cmCTestVC::LineParser
public: public:
InfoParser(cmCTestBZR* bzr, const char* prefix) InfoParser(cmCTestBZR* bzr, const char* prefix)
: BZR(bzr) : BZR(bzr)
, CheckOutFound(false)
{ {
this->SetLog(&bzr->Log, prefix); this->SetLog(&bzr->Log, prefix);
this->RegexCheckOut.compile("checkout of branch: *([^\t\r\n]+)$"); this->RegexCheckOut.compile("checkout of branch: *([^\t\r\n]+)$");
@ -97,7 +96,7 @@ public:
private: private:
cmCTestBZR* BZR; cmCTestBZR* BZR;
bool CheckOutFound; bool CheckOutFound = false;
cmsys::RegularExpression RegexCheckOut; cmsys::RegularExpression RegexCheckOut;
cmsys::RegularExpression RegexParent; cmsys::RegularExpression RegexParent;
bool ProcessLine() override bool ProcessLine() override

View File

@ -111,7 +111,6 @@ public:
LogParser(cmCTestCVS* cvs, const char* prefix, std::vector<Revision>& revs) LogParser(cmCTestCVS* cvs, const char* prefix, std::vector<Revision>& revs)
: CVS(cvs) : CVS(cvs)
, Revisions(revs) , Revisions(revs)
, Section(SectionHeader)
{ {
this->SetLog(&cvs->Log, prefix); this->SetLog(&cvs->Log, prefix);
this->RegexRevision.compile("^revision +([^ ]*) *$"); this->RegexRevision.compile("^revision +([^ ]*) *$");
@ -131,7 +130,7 @@ private:
SectionRevisions, SectionRevisions,
SectionEnd SectionEnd
}; };
SectionType Section; SectionType Section = SectionHeader;
Revision Rev; Revision Rev;
bool ProcessLine() override bool ProcessLine() override

View File

@ -332,7 +332,6 @@ public:
DiffParser(cmCTestGIT* git, const char* prefix) DiffParser(cmCTestGIT* git, const char* prefix)
: LineParser('\0', false) : LineParser('\0', false)
, GIT(git) , GIT(git)
, DiffField(DiffFieldNone)
{ {
this->SetLog(&git->Log, prefix); this->SetLog(&git->Log, prefix);
} }
@ -349,7 +348,7 @@ protected:
DiffFieldSrc, DiffFieldSrc,
DiffFieldDst DiffFieldDst
}; };
DiffFieldType DiffField; DiffFieldType DiffField = DiffFieldNone;
Change CurChange; Change CurChange;
void DiffReset() void DiffReset()
@ -454,7 +453,6 @@ class cmCTestGIT::CommitParser : public cmCTestGIT::DiffParser
public: public:
CommitParser(cmCTestGIT* git, const char* prefix) CommitParser(cmCTestGIT* git, const char* prefix)
: DiffParser(git, prefix) : DiffParser(git, prefix)
, Section(SectionHeader)
{ {
this->Separator = SectionSep[this->Section]; this->Separator = SectionSep[this->Section];
} }
@ -469,7 +467,7 @@ private:
SectionCount SectionCount
}; };
static char const SectionSep[SectionCount]; static char const SectionSep[SectionCount];
SectionType Section; SectionType Section = SectionHeader;
Revision Rev; Revision Rev;
struct Person struct Person

View File

@ -118,7 +118,6 @@ class cmCTestP4::DiffParser : public cmCTestVC::LineParser
public: public:
DiffParser(cmCTestP4* p4, const char* prefix) DiffParser(cmCTestP4* p4, const char* prefix)
: P4(p4) : P4(p4)
, AlreadyNotified(false)
{ {
this->SetLog(&this->P4->Log, prefix); this->SetLog(&this->P4->Log, prefix);
this->RegexDiff.compile("^==== (.*)#[0-9]+ - (.*)"); this->RegexDiff.compile("^==== (.*)#[0-9]+ - (.*)");
@ -126,7 +125,7 @@ public:
private: private:
cmCTestP4* P4; cmCTestP4* P4;
bool AlreadyNotified; bool AlreadyNotified = false;
std::string CurrentPath; std::string CurrentPath;
cmsys::RegularExpression RegexDiff; cmsys::RegularExpression RegexDiff;
@ -193,7 +192,6 @@ public:
DescribeParser(cmCTestP4* p4, const char* prefix) DescribeParser(cmCTestP4* p4, const char* prefix)
: LineParser('\n', false) : LineParser('\n', false)
, P4(p4) , P4(p4)
, Section(SectionHeader)
{ {
this->SetLog(&this->P4->Log, prefix); this->SetLog(&this->P4->Log, prefix);
this->RegexHeader.compile("^Change ([0-9]+) by (.+)@(.+) on (.*)$"); this->RegexHeader.compile("^Change ([0-9]+) by (.+)@(.+) on (.*)$");
@ -216,7 +214,7 @@ private:
SectionDiff, SectionDiff,
SectionCount SectionCount
}; };
SectionType Section; SectionType Section = SectionHeader;
Revision Rev; Revision Rev;
bool ProcessLine() override bool ProcessLine() override

View File

@ -66,7 +66,6 @@ class QCMakeAdvancedFilter : public QSortFilterProxyModel
public: public:
QCMakeAdvancedFilter(QObject* o) QCMakeAdvancedFilter(QObject* o)
: QSortFilterProxyModel(o) : QSortFilterProxyModel(o)
, ShowAdvanced(false)
{ {
} }
@ -78,7 +77,7 @@ public:
bool showAdvanced() const { return this->ShowAdvanced; } bool showAdvanced() const { return this->ShowAdvanced; }
protected: protected:
bool ShowAdvanced; bool ShowAdvanced = false;
bool filterAcceptsRow(int row, const QModelIndex& p) const override bool filterAcceptsRow(int row, const QModelIndex& p) const override
{ {

View File

@ -92,7 +92,6 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c,
: Stream(os) : Stream(os)
, Archive(archive_write_new()) , Archive(archive_write_new())
, Disk(archive_read_disk_new()) , Disk(archive_read_disk_new())
, Verbose(false)
, Format(format) , Format(format)
{ {
// Upstream fixed an issue with their integer parsing in 3.4.0 // Upstream fixed an issue with their integer parsing in 3.4.0

View File

@ -156,7 +156,7 @@ private:
std::ostream& Stream; std::ostream& Stream;
struct archive* Archive; struct archive* Archive;
struct archive* Disk; struct archive* Disk;
bool Verbose; bool Verbose = false;
std::string Format; std::string Format;
std::string Error; std::string Error;
std::string MTime; std::string MTime;

View File

@ -32,11 +32,7 @@ class LanguageStandardState
{ {
public: public:
LanguageStandardState(std::string&& lang) LanguageStandardState(std::string&& lang)
: IsEnabled(false) : StandardFlag(lang + "_STANDARD")
, DidStandard(false)
, DidStandardRequired(false)
, DidExtensions(false)
, StandardFlag(lang + "_STANDARD")
, RequiredFlag(lang + "_STANDARD_REQUIRED") , RequiredFlag(lang + "_STANDARD_REQUIRED")
, ExtensionFlag(lang + "_EXTENSIONS") , ExtensionFlag(lang + "_EXTENSIONS")
{ {
@ -154,10 +150,10 @@ public:
} }
private: private:
bool IsEnabled; bool IsEnabled = false;
bool DidStandard; bool DidStandard = false;
bool DidStandardRequired; bool DidStandardRequired = false;
bool DidExtensions; bool DidExtensions = false;
std::string StandardFlag; std::string StandardFlag;
std::string RequiredFlag; std::string RequiredFlag;

View File

@ -83,7 +83,6 @@ public:
: External(external) : External(external)
, Stream(std::move(fin)) , Stream(std::move(fin))
, ByteOrder(order) , ByteOrder(order)
, ELFType(cmELF::FileTypeInvalid)
{ {
// In most cases the processor-specific byte order will match that // In most cases the processor-specific byte order will match that
// of the target execution environment. If we choose wrong here // of the target execution environment. If we choose wrong here
@ -150,7 +149,7 @@ protected:
ByteOrderType ByteOrder; ByteOrderType ByteOrder;
// The ELF file type. // The ELF file type.
cmELF::FileType ELFType; cmELF::FileType ELFType = cmELF::FileTypeInvalid;
// The ELF architecture. // The ELF architecture.
std::uint16_t Machine; std::uint16_t Machine;

View File

@ -27,16 +27,6 @@ cmFileCopier::cmFileCopier(cmExecutionStatus& status, const char* name)
: Status(status) : Status(status)
, Makefile(&status.GetMakefile()) , Makefile(&status.GetMakefile())
, Name(name) , Name(name)
, Always(false)
, MatchlessFiles(true)
, FilePermissions(0)
, DirPermissions(0)
, CurrentMatchRule(nullptr)
, UseGivenPermissionsFile(false)
, UseGivenPermissionsDir(false)
, UseSourcePermissions(true)
, FollowSymlinkChain(false)
, Doing(DoingNone)
{ {
} }

View File

@ -28,15 +28,15 @@ protected:
cmExecutionStatus& Status; cmExecutionStatus& Status;
cmMakefile* Makefile; cmMakefile* Makefile;
const char* Name; const char* Name;
bool Always; bool Always = false;
cmFileTimeCache FileTimes; cmFileTimeCache FileTimes;
// Whether to install a file not matching any expression. // Whether to install a file not matching any expression.
bool MatchlessFiles; bool MatchlessFiles = true;
// Permissions for files and directories installed by this object. // Permissions for files and directories installed by this object.
mode_t FilePermissions; mode_t FilePermissions = 0;
mode_t DirPermissions; mode_t DirPermissions = 0;
// Properties set by pattern and regex match rules. // Properties set by pattern and regex match rules.
struct MatchProperties struct MatchProperties
@ -85,17 +85,15 @@ protected:
virtual void ReportCopy(const std::string&, Type, bool) {} virtual void ReportCopy(const std::string&, Type, bool) {}
virtual bool ReportMissing(const std::string& fromFile); virtual bool ReportMissing(const std::string& fromFile);
MatchRule* CurrentMatchRule; MatchRule* CurrentMatchRule = nullptr;
bool UseGivenPermissionsFile; bool UseGivenPermissionsFile = false;
bool UseGivenPermissionsDir; bool UseGivenPermissionsDir = false;
bool UseSourcePermissions; bool UseSourcePermissions = true;
bool FollowSymlinkChain; bool FollowSymlinkChain = false;
std::string Destination; std::string Destination;
std::string FilesFromDir; std::string FilesFromDir;
std::vector<std::string> Files; std::vector<std::string> Files;
int Doing;
virtual bool Parse(std::vector<std::string> const& args);
enum enum
{ {
DoingNone, DoingNone,
@ -110,6 +108,9 @@ protected:
DoingPermissionsMatch, DoingPermissionsMatch,
DoingLast1 DoingLast1
}; };
int Doing = DoingNone;
virtual bool Parse(std::vector<std::string> const& args);
virtual bool CheckKeyword(std::string const& arg); virtual bool CheckKeyword(std::string const& arg);
virtual bool CheckValue(std::string const& arg); virtual bool CheckValue(std::string const& arg);

View File

@ -23,13 +23,6 @@ using namespace cmFSPermissions;
cmFileInstaller::cmFileInstaller(cmExecutionStatus& status) cmFileInstaller::cmFileInstaller(cmExecutionStatus& status)
: cmFileCopier(status, "INSTALL") : cmFileCopier(status, "INSTALL")
, InstallType(cmInstallType_FILES)
, InstallMode(cmInstallMode::COPY)
, Optional(false)
, MessageAlways(false)
, MessageLazy(false)
, MessageNever(false)
, DestDirLength(0)
{ {
// Installation does not use source permissions by default. // Installation does not use source permissions by default.
this->UseSourcePermissions = false; this->UseSourcePermissions = false;

View File

@ -19,13 +19,13 @@ struct cmFileInstaller : public cmFileCopier
~cmFileInstaller() override; ~cmFileInstaller() override;
protected: protected:
cmInstallType InstallType; cmInstallType InstallType = cmInstallType_FILES;
cmInstallMode InstallMode; cmInstallMode InstallMode = cmInstallMode::COPY;
bool Optional; bool Optional = false;
bool MessageAlways; bool MessageAlways = false;
bool MessageLazy; bool MessageLazy = false;
bool MessageNever; bool MessageNever = false;
int DestDirLength; int DestDirLength = 0;
std::string Rename; std::string Rename;
std::string Manifest; std::string Manifest;

View File

@ -123,13 +123,12 @@ struct cmFortranFile
: File(file) : File(file)
, Buffer(buffer) , Buffer(buffer)
, Directory(std::move(dir)) , Directory(std::move(dir))
, LastCharWasNewline(false)
{ {
} }
FILE* File; FILE* File;
YY_BUFFER_STATE Buffer; YY_BUFFER_STATE Buffer;
std::string Directory; std::string Directory;
bool LastCharWasNewline; bool LastCharWasNewline = false;
}; };
struct cmFortranCompiler struct cmFortranCompiler

View File

@ -100,11 +100,6 @@ cmCompiledGeneratorExpression::cmCompiledGeneratorExpression(
cmListFileBacktrace backtrace, std::string input) cmListFileBacktrace backtrace, std::string input)
: Backtrace(std::move(backtrace)) : Backtrace(std::move(backtrace))
, Input(std::move(input)) , Input(std::move(input))
, EvaluateForBuildsystem(false)
, Quiet(false)
, HadContextSensitiveCondition(false)
, HadHeadSensitiveCondition(false)
, HadLinkLanguageSensitiveCondition(false)
{ {
cmGeneratorExpressionLexer l; cmGeneratorExpressionLexer l;
std::vector<cmGeneratorExpressionToken> tokens = l.Tokenize(this->Input); std::vector<cmGeneratorExpressionToken> tokens = l.Tokenize(this->Input);

View File

@ -161,8 +161,8 @@ private:
std::vector<std::unique_ptr<cmGeneratorExpressionEvaluator>> Evaluators; std::vector<std::unique_ptr<cmGeneratorExpressionEvaluator>> Evaluators;
const std::string Input; const std::string Input;
bool NeedsEvaluation; bool NeedsEvaluation;
bool EvaluateForBuildsystem; bool EvaluateForBuildsystem = false;
bool Quiet; bool Quiet = false;
mutable std::set<cmGeneratorTarget*> DependTargets; mutable std::set<cmGeneratorTarget*> DependTargets;
mutable std::set<cmGeneratorTarget const*> AllTargetsSeen; mutable std::set<cmGeneratorTarget const*> AllTargetsSeen;
@ -171,9 +171,9 @@ private:
std::map<std::string, std::string>> std::map<std::string, std::string>>
MaxLanguageStandard; MaxLanguageStandard;
mutable std::string Output; mutable std::string Output;
mutable bool HadContextSensitiveCondition; mutable bool HadContextSensitiveCondition = false;
mutable bool HadHeadSensitiveCondition; mutable bool HadHeadSensitiveCondition = false;
mutable bool HadLinkLanguageSensitiveCondition; mutable bool HadLinkLanguageSensitiveCondition = false;
mutable std::set<cmGeneratorTarget const*> SourceSensitiveTargets; mutable std::set<cmGeneratorTarget const*> SourceSensitiveTargets;
}; };

View File

@ -16,10 +16,6 @@ cmGeneratorExpressionContext::cmGeneratorExpressionContext(
, HeadTarget(headTarget) , HeadTarget(headTarget)
, CurrentTarget(currentTarget) , CurrentTarget(currentTarget)
, Quiet(quiet) , Quiet(quiet)
, HadError(false)
, HadContextSensitiveCondition(false)
, HadHeadSensitiveCondition(false)
, HadLinkLanguageSensitiveCondition(false)
, EvaluateForBuildsystem(evaluateForBuildsystem) , EvaluateForBuildsystem(evaluateForBuildsystem)
{ {
} }

View File

@ -36,9 +36,9 @@ struct cmGeneratorExpressionContext
// directly or indirectly in the property. // directly or indirectly in the property.
cmGeneratorTarget const* CurrentTarget; cmGeneratorTarget const* CurrentTarget;
bool Quiet; bool Quiet;
bool HadError; bool HadError = false;
bool HadContextSensitiveCondition; bool HadContextSensitiveCondition = false;
bool HadHeadSensitiveCondition; bool HadHeadSensitiveCondition = false;
bool HadLinkLanguageSensitiveCondition; bool HadLinkLanguageSensitiveCondition = false;
bool EvaluateForBuildsystem; bool EvaluateForBuildsystem;
}; };

View File

@ -15,7 +15,6 @@
cmGeneratorExpressionParser::cmGeneratorExpressionParser( cmGeneratorExpressionParser::cmGeneratorExpressionParser(
std::vector<cmGeneratorExpressionToken> tokens) std::vector<cmGeneratorExpressionToken> tokens)
: Tokens(std::move(tokens)) : Tokens(std::move(tokens))
, NestingLevel(0)
{ {
} }

View File

@ -26,5 +26,5 @@ private:
std::vector<cmGeneratorExpressionToken>::const_iterator it; std::vector<cmGeneratorExpressionToken>::const_iterator it;
const std::vector<cmGeneratorExpressionToken> Tokens; const std::vector<cmGeneratorExpressionToken> Tokens;
unsigned int NestingLevel; unsigned int NestingLevel = 0;
}; };

View File

@ -335,20 +335,6 @@ EvaluatedTargetPropertyEntries EvaluateTargetPropertyEntries(
cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
: Target(t) : Target(t)
, FortranModuleDirectoryCreated(false)
, SourceFileFlagsConstructed(false)
, PolicyWarnedCMP0022(false)
, PolicyReportedCMP0069(false)
, DebugIncludesDone(false)
, DebugCompileOptionsDone(false)
, DebugCompileFeaturesDone(false)
, DebugCompileDefinitionsDone(false)
, DebugLinkOptionsDone(false)
, DebugLinkDirectoriesDone(false)
, DebugPrecompileHeadersDone(false)
, DebugSourcesDone(false)
, UtilityItemsDone(false)
, SourcesAreContextDependent(Tribool::Indeterminate)
{ {
this->Makefile = this->Target->GetMakefile(); this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = lg; this->LocalGenerator = lg;
@ -2775,15 +2761,14 @@ cmGeneratorTarget::LinkClosure const* cmGeneratorTarget::GetLinkClosure(
class cmTargetSelectLinker class cmTargetSelectLinker
{ {
int Preference; int Preference = 0;
cmGeneratorTarget const* Target; cmGeneratorTarget const* Target;
cmGlobalGenerator* GG; cmGlobalGenerator* GG;
std::set<std::string> Preferred; std::set<std::string> Preferred;
public: public:
cmTargetSelectLinker(cmGeneratorTarget const* target) cmTargetSelectLinker(cmGeneratorTarget const* target)
: Preference(0) : Target(target)
, Target(target)
{ {
this->GG = this->Target->GetLocalGenerator()->GetGlobalGenerator(); this->GG = this->Target->GetLocalGenerator()->GetGlobalGenerator();
} }

View File

@ -881,7 +881,7 @@ private:
std::string CreateFortranModuleDirectory( std::string CreateFortranModuleDirectory(
std::string const& working_dir) const; std::string const& working_dir) const;
mutable bool FortranModuleDirectoryCreated; mutable bool FortranModuleDirectoryCreated = false;
mutable std::string FortranModuleDirectory; mutable std::string FortranModuleDirectory;
friend class cmTargetTraceDependencies; friend class cmTargetTraceDependencies;
@ -906,7 +906,7 @@ private:
mutable std::string ExportMacro; mutable std::string ExportMacro;
void ConstructSourceFileFlags() const; void ConstructSourceFileFlags() const;
mutable bool SourceFileFlagsConstructed; mutable bool SourceFileFlagsConstructed = false;
mutable std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap; mutable std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap;
mutable std::map<std::string, bool> DebugCompatiblePropertiesDone; mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
@ -1143,24 +1143,24 @@ private:
mutable OutputNameMapType OutputNameMap; mutable OutputNameMapType OutputNameMap;
mutable std::set<cmLinkItem> UtilityItems; mutable std::set<cmLinkItem> UtilityItems;
cmPolicies::PolicyMap PolicyMap; cmPolicies::PolicyMap PolicyMap;
mutable bool PolicyWarnedCMP0022; mutable bool PolicyWarnedCMP0022 = false;
mutable bool PolicyReportedCMP0069; mutable bool PolicyReportedCMP0069 = false;
mutable bool DebugIncludesDone; mutable bool DebugIncludesDone = false;
mutable bool DebugCompileOptionsDone; mutable bool DebugCompileOptionsDone = false;
mutable bool DebugCompileFeaturesDone; mutable bool DebugCompileFeaturesDone = false;
mutable bool DebugCompileDefinitionsDone; mutable bool DebugCompileDefinitionsDone = false;
mutable bool DebugLinkOptionsDone; mutable bool DebugLinkOptionsDone = false;
mutable bool DebugLinkDirectoriesDone; mutable bool DebugLinkDirectoriesDone = false;
mutable bool DebugPrecompileHeadersDone; mutable bool DebugPrecompileHeadersDone = false;
mutable bool DebugSourcesDone; mutable bool DebugSourcesDone = false;
mutable bool UtilityItemsDone; mutable bool UtilityItemsDone = false;
enum class Tribool enum class Tribool
{ {
False = 0x0, False = 0x0,
True = 0x1, True = 0x1,
Indeterminate = 0x2 Indeterminate = 0x2
}; };
mutable Tribool SourcesAreContextDependent; mutable Tribool SourcesAreContextDependent = Tribool::Indeterminate;
bool ComputePDBOutputDir(const std::string& kind, const std::string& config, bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
std::string& out) const; std::string& out) const;

View File

@ -109,18 +109,6 @@ cmGraphVizWriter::cmGraphVizWriter(std::string const& fileName,
, GraphHeader("node [\n fontsize = \"12\"\n];") , GraphHeader("node [\n fontsize = \"12\"\n];")
, GraphNodePrefix("node") , GraphNodePrefix("node")
, GlobalGenerator(globalGenerator) , GlobalGenerator(globalGenerator)
, NextNodeId(0)
, GenerateForExecutables(true)
, GenerateForStaticLibs(true)
, GenerateForSharedLibs(true)
, GenerateForModuleLibs(true)
, GenerateForInterfaceLibs(true)
, GenerateForObjectLibs(true)
, GenerateForUnknownLibs(true)
, GenerateForCustomTargets(false)
, GenerateForExternals(true)
, GeneratePerTarget(true)
, GenerateDependers(true)
{ {
} }

View File

@ -119,19 +119,19 @@ private:
cmGlobalGenerator const* GlobalGenerator; cmGlobalGenerator const* GlobalGenerator;
int NextNodeId; int NextNodeId = 0;
// maps from the actual item names to node names in dot: // maps from the actual item names to node names in dot:
std::map<std::string, std::string> NodeNames; std::map<std::string, std::string> NodeNames;
bool GenerateForExecutables; bool GenerateForExecutables = true;
bool GenerateForStaticLibs; bool GenerateForStaticLibs = true;
bool GenerateForSharedLibs; bool GenerateForSharedLibs = true;
bool GenerateForModuleLibs; bool GenerateForModuleLibs = true;
bool GenerateForInterfaceLibs; bool GenerateForInterfaceLibs = true;
bool GenerateForObjectLibs; bool GenerateForObjectLibs = true;
bool GenerateForUnknownLibs; bool GenerateForUnknownLibs = true;
bool GenerateForCustomTargets; bool GenerateForCustomTargets = false;
bool GenerateForExternals; bool GenerateForExternals = true;
bool GeneratePerTarget; bool GeneratePerTarget = true;
bool GenerateDependers; bool GenerateDependers = true;
}; };

View File

@ -20,7 +20,6 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator(
bool optional, cmListFileBacktrace backtrace) bool optional, cmListFileBacktrace backtrace)
: cmInstallGenerator(dest, configurations, component, message, : cmInstallGenerator(dest, configurations, component, message,
exclude_from_all, false, std::move(backtrace)) exclude_from_all, false, std::move(backtrace))
, LocalGenerator(nullptr)
, Directories(dirs) , Directories(dirs)
, FilePermissions(std::move(file_permissions)) , FilePermissions(std::move(file_permissions))
, DirPermissions(std::move(dir_permissions)) , DirPermissions(std::move(dir_permissions))

View File

@ -42,7 +42,7 @@ protected:
void AddDirectoryInstallRule(std::ostream& os, const std::string& config, void AddDirectoryInstallRule(std::ostream& os, const std::string& config,
Indent indent, Indent indent,
std::vector<std::string> const& dirs); std::vector<std::string> const& dirs);
cmLocalGenerator* LocalGenerator; cmLocalGenerator* LocalGenerator = nullptr;
std::vector<std::string> const Directories; std::vector<std::string> const Directories;
std::string const FilePermissions; std::string const FilePermissions;
std::string const DirPermissions; std::string const DirPermissions;

View File

@ -32,7 +32,6 @@ cmInstallExportGenerator::cmInstallExportGenerator(
, FileName(std::move(filename)) , FileName(std::move(filename))
, Namespace(std::move(name_space)) , Namespace(std::move(name_space))
, ExportOld(exportOld) , ExportOld(exportOld)
, LocalGenerator(nullptr)
{ {
if (android) { if (android) {
#ifndef CMAKE_BOOTSTRAP #ifndef CMAKE_BOOTSTRAP

View File

@ -65,7 +65,7 @@ protected:
std::string const FileName; std::string const FileName;
std::string const Namespace; std::string const Namespace;
bool const ExportOld; bool const ExportOld;
cmLocalGenerator* LocalGenerator; cmLocalGenerator* LocalGenerator = nullptr;
std::string TempDir; std::string TempDir;
std::string MainImportFile; std::string MainImportFile;

View File

@ -19,7 +19,6 @@ cmInstallFilesGenerator::cmInstallFilesGenerator(
bool optional, cmListFileBacktrace backtrace) bool optional, cmListFileBacktrace backtrace)
: cmInstallGenerator(dest, configurations, component, message, : cmInstallGenerator(dest, configurations, component, message,
exclude_from_all, false, std::move(backtrace)) exclude_from_all, false, std::move(backtrace))
, LocalGenerator(nullptr)
, Files(files) , Files(files)
, FilePermissions(std::move(file_permissions)) , FilePermissions(std::move(file_permissions))
, Rename(std::move(rename)) , Rename(std::move(rename))

View File

@ -44,7 +44,7 @@ protected:
Indent indent, Indent indent,
std::vector<std::string> const& files); std::vector<std::string> const& files);
cmLocalGenerator* LocalGenerator; cmLocalGenerator* LocalGenerator = nullptr;
std::vector<std::string> const Files; std::vector<std::string> const Files;
std::string const FilePermissions; std::string const FilePermissions;
std::string const Rename; std::string const Rename;

View File

@ -20,7 +20,6 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(
std::move(backtrace)) std::move(backtrace))
, Script(std::move(script)) , Script(std::move(script))
, Code(code) , Code(code)
, AllowGenex(false)
{ {
// We need per-config actions if the script has generator expressions. // We need per-config actions if the script has generator expressions.
if (cmGeneratorExpression::Find(this->Script) != std::string::npos) { if (cmGeneratorExpression::Find(this->Script) != std::string::npos) {

View File

@ -41,5 +41,5 @@ protected:
std::string const Script; std::string const Script;
bool const Code; bool const Code;
cmLocalGenerator* LocalGenerator; cmLocalGenerator* LocalGenerator;
bool AllowGenex; bool AllowGenex = false;
}; };

View File

@ -50,7 +50,6 @@ cmInstallTargetGenerator::cmInstallTargetGenerator(
: cmInstallGenerator(dest, configurations, component, message, : cmInstallGenerator(dest, configurations, component, message,
exclude_from_all, false, std::move(backtrace)) exclude_from_all, false, std::move(backtrace))
, TargetName(std::move(targetName)) , TargetName(std::move(targetName))
, Target(nullptr)
, FilePermissions(std::move(file_permissions)) , FilePermissions(std::move(file_permissions))
, ImportLibrary(implib) , ImportLibrary(implib)
, Optional(optional) , Optional(optional)

View File

@ -118,7 +118,7 @@ protected:
void IssueCMP0095Warning(const std::string& unescapedRpath); void IssueCMP0095Warning(const std::string& unescapedRpath);
std::string const TargetName; std::string const TargetName;
cmGeneratorTarget* Target; cmGeneratorTarget* Target = nullptr;
std::string const FilePermissions; std::string const FilePermissions;
NamelinkModeType NamelinkMode; NamelinkModeType NamelinkMode;
bool const ImportLibrary; bool const ImportLibrary;

View File

@ -18,10 +18,6 @@ cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir) cmStateDirectory const& stateDir)
: StateDir(stateDir) : StateDir(stateDir)
, OutputConverter(outputConverter) , OutputConverter(outputConverter)
, ForResponse(false)
, UseWatcomQuote(false)
, UseNinjaMulti(false)
, Relink(false)
{ {
} }

View File

@ -67,8 +67,8 @@ protected:
cmStateDirectory StateDir; cmStateDirectory StateDir;
cmOutputConverter* OutputConverter; cmOutputConverter* OutputConverter;
bool ForResponse; bool ForResponse = false;
bool UseWatcomQuote; bool UseWatcomQuote = false;
bool UseNinjaMulti; bool UseNinjaMulti = false;
bool Relink; bool Relink = false;
}; };

View File

@ -36,7 +36,7 @@ struct cmListFileParser
cmListFile* ListFile; cmListFile* ListFile;
cmListFileBacktrace Backtrace; cmListFileBacktrace Backtrace;
cmMessenger* Messenger; cmMessenger* Messenger;
const char* FileName; const char* FileName = nullptr;
cmListFileLexer* Lexer; cmListFileLexer* Lexer;
std::string FunctionName; std::string FunctionName;
long FunctionLine; long FunctionLine;
@ -55,7 +55,6 @@ cmListFileParser::cmListFileParser(cmListFile* lf, cmListFileBacktrace lfbt,
: ListFile(lf) : ListFile(lf)
, Backtrace(std::move(lfbt)) , Backtrace(std::move(lfbt))
, Messenger(messenger) , Messenger(messenger)
, FileName(nullptr)
, Lexer(cmListFileLexer_New()) , Lexer(cmListFileLexer_New())
{ {
} }

View File

@ -478,8 +478,8 @@ public:
private: private:
cmMakefile* Makefile; cmMakefile* Makefile;
bool NoPolicyScope; bool NoPolicyScope;
bool CheckCMP0011; bool CheckCMP0011 = false;
bool ReportError; bool ReportError = true;
void EnforceCMP0011(); void EnforceCMP0011();
}; };
@ -488,8 +488,6 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
bool noPolicyScope) bool noPolicyScope)
: Makefile(mf) : Makefile(mf)
, NoPolicyScope(noPolicyScope) , NoPolicyScope(noPolicyScope)
, CheckCMP0011(false)
, ReportError(true)
{ {
this->Makefile->Backtrace = this->Makefile->Backtrace.Push( this->Makefile->Backtrace = this->Makefile->Backtrace.Push(
cmListFileContext::FromListFilePath(filenametoread)); cmListFileContext::FromListFilePath(filenametoread));
@ -623,7 +621,6 @@ class cmMakefile::ListFileScope
public: public:
ListFileScope(cmMakefile* mf, std::string const& filenametoread) ListFileScope(cmMakefile* mf, std::string const& filenametoread)
: Makefile(mf) : Makefile(mf)
, ReportError(true)
{ {
this->Makefile->Backtrace = this->Makefile->Backtrace.Push( this->Makefile->Backtrace = this->Makefile->Backtrace.Push(
cmListFileContext::FromListFilePath(filenametoread)); cmListFileContext::FromListFilePath(filenametoread));
@ -650,7 +647,7 @@ public:
private: private:
cmMakefile* Makefile; cmMakefile* Makefile;
bool ReportError; bool ReportError = true;
}; };
class cmMakefile::DeferScope class cmMakefile::DeferScope
@ -1536,7 +1533,6 @@ class cmMakefile::BuildsystemFileScope
public: public:
BuildsystemFileScope(cmMakefile* mf) BuildsystemFileScope(cmMakefile* mf)
: Makefile(mf) : Makefile(mf)
, ReportError(true)
{ {
std::string currentStart = std::string currentStart =
cmStrCat(this->Makefile->StateSnapshot.GetDirectory().GetCurrentSource(), cmStrCat(this->Makefile->StateSnapshot.GetDirectory().GetCurrentSource(),
@ -1578,7 +1574,7 @@ private:
cmGlobalGenerator* GG; cmGlobalGenerator* GG;
cmMakefile* CurrentMakefile; cmMakefile* CurrentMakefile;
cmStateSnapshot Snapshot; cmStateSnapshot Snapshot;
bool ReportError; bool ReportError = true;
}; };
void cmMakefile::Configure() void cmMakefile::Configure()
@ -4538,7 +4534,6 @@ cmMakefile::FunctionPushPop::FunctionPushPop(cmMakefile* mf,
const std::string& fileName, const std::string& fileName,
cmPolicies::PolicyMap const& pm) cmPolicies::PolicyMap const& pm)
: Makefile(mf) : Makefile(mf)
, ReportError(true)
{ {
this->Makefile->PushFunctionScope(fileName, pm); this->Makefile->PushFunctionScope(fileName, pm);
} }
@ -4552,7 +4547,6 @@ cmMakefile::MacroPushPop::MacroPushPop(cmMakefile* mf,
const std::string& fileName, const std::string& fileName,
const cmPolicies::PolicyMap& pm) const cmPolicies::PolicyMap& pm)
: Makefile(mf) : Makefile(mf)
, ReportError(true)
{ {
this->Makefile->PushMacroScope(fileName, pm); this->Makefile->PushMacroScope(fileName, pm);
} }

View File

@ -833,7 +833,7 @@ public:
private: private:
cmMakefile* Makefile; cmMakefile* Makefile;
bool ReportError; bool ReportError = true;
}; };
class MacroPushPop class MacroPushPop
@ -850,7 +850,7 @@ public:
private: private:
cmMakefile* Makefile; cmMakefile* Makefile;
bool ReportError; bool ReportError = true;
}; };
void PushFunctionScope(std::string const& fileName, void PushFunctionScope(std::string const& fileName,

View File

@ -18,7 +18,6 @@ cmOSXBundleGenerator::cmOSXBundleGenerator(cmGeneratorTarget* target)
: GT(target) : GT(target)
, Makefile(target->Target->GetMakefile()) , Makefile(target->Target->GetMakefile())
, LocalGenerator(target->GetLocalGenerator()) , LocalGenerator(target->GetLocalGenerator())
, MacContentFolders(nullptr)
{ {
if (this->MustSkip()) { if (this->MustSkip()) {
return; return;

View File

@ -65,5 +65,5 @@ private:
cmGeneratorTarget* GT; cmGeneratorTarget* GT;
cmMakefile* Makefile; cmMakefile* Makefile;
cmLocalGenerator* LocalGenerator; cmLocalGenerator* LocalGenerator;
std::set<std::string>* MacContentFolders; std::set<std::string>* MacContentFolders = nullptr;
}; };

View File

@ -29,7 +29,6 @@ bool PathEqOrSubDir(std::string const& a, std::string const& b)
cmOutputConverter::cmOutputConverter(cmStateSnapshot const& snapshot) cmOutputConverter::cmOutputConverter(cmStateSnapshot const& snapshot)
: StateSnapshot(snapshot) : StateSnapshot(snapshot)
, LinkScriptShell(false)
{ {
assert(this->StateSnapshot.IsValid()); assert(this->StateSnapshot.IsValid());
this->ComputeRelativePathTopSource(); this->ComputeRelativePathTopSource();

View File

@ -138,7 +138,7 @@ private:
static bool Shell_ArgumentNeedsQuotes(cm::string_view in, int flags); static bool Shell_ArgumentNeedsQuotes(cm::string_view in, int flags);
static std::string Shell_GetArgument(cm::string_view in, int flags); static std::string Shell_GetArgument(cm::string_view in, int flags);
bool LinkScriptShell; bool LinkScriptShell = false;
// The top-most directories for relative path conversion. Both the // The top-most directories for relative path conversion. Both the
// source and destination location of a relative path conversion // source and destination location of a relative path conversion

View File

@ -19,11 +19,6 @@
cmRST::cmRST(std::ostream& os, std::string docroot) cmRST::cmRST(std::ostream& os, std::string docroot)
: OS(os) : OS(os)
, DocRoot(std::move(docroot)) , DocRoot(std::move(docroot))
, IncludeDepth(0)
, OutputLinePending(false)
, LastLineEndedInColonColon(false)
, Markup(MarkupNone)
, Directive(DirectiveNone)
, CMakeDirective("^.. (cmake:)?(" , CMakeDirective("^.. (cmake:)?("
"command|envvar|genex|variable" "command|envvar|genex|variable"
")::[ \t]+([^ \t\n]+)$") ")::[ \t]+([^ \t\n]+)$")

View File

@ -69,11 +69,11 @@ private:
std::ostream& OS; std::ostream& OS;
std::string DocRoot; std::string DocRoot;
int IncludeDepth; int IncludeDepth = 0;
bool OutputLinePending; bool OutputLinePending = false;
bool LastLineEndedInColonColon; bool LastLineEndedInColonColon = false;
MarkupType Markup; MarkupType Markup = MarkupNone;
DirectiveType Directive; DirectiveType Directive = DirectiveNone;
cmsys::RegularExpression CMakeDirective; cmsys::RegularExpression CMakeDirective;
cmsys::RegularExpression CMakeModuleDirective; cmsys::RegularExpression CMakeModuleDirective;
cmsys::RegularExpression ParsedLiteralDirective; cmsys::RegularExpression ParsedLiteralDirective;

View File

@ -12,8 +12,6 @@ cmScriptGenerator::cmScriptGenerator(std::string config_var,
std::vector<std::string> configurations) std::vector<std::string> configurations)
: RuntimeConfigVariable(std::move(config_var)) : RuntimeConfigVariable(std::move(config_var))
, Configurations(std::move(configurations)) , Configurations(std::move(configurations))
, ConfigurationTypes(nullptr)
, ActionsPerConfig(false)
{ {
} }

View File

@ -78,12 +78,12 @@ protected:
// Information used during generation. // Information used during generation.
std::string ConfigurationName; std::string ConfigurationName;
std::vector<std::string> const* ConfigurationTypes; std::vector<std::string> const* ConfigurationTypes = nullptr;
// True if the subclass needs to generate an explicit rule for each // True if the subclass needs to generate an explicit rule for each
// configuration. False if the subclass only generates one rule for // configuration. False if the subclass only generates one rule for
// all enabled configurations. // all enabled configurations.
bool ActionsPerConfig; bool ActionsPerConfig = false;
private: private:
void GenerateScriptActionsOnce(std::ostream& os, Indent indent); void GenerateScriptActionsOnce(std::ostream& os, Indent indent);

View File

@ -18,17 +18,14 @@ class cmTargetDepend
// The set order depends only on the Target, so we use // The set order depends only on the Target, so we use
// mutable members to achieve a map with set syntax. // mutable members to achieve a map with set syntax.
mutable bool Link; mutable bool Link = false;
mutable bool Util; mutable bool Util = false;
mutable bool Cross; mutable bool Cross = false;
mutable cmListFileBacktrace Backtrace; mutable cmListFileBacktrace Backtrace;
public: public:
cmTargetDepend(cmGeneratorTarget const* t) cmTargetDepend(cmGeneratorTarget const* t)
: Target(t) : Target(t)
, Link(false)
, Util(false)
, Cross(false)
{ {
} }
operator cmGeneratorTarget const*() const { return this->Target; } operator cmGeneratorTarget const*() const { return this->Target; }

View File

@ -8,8 +8,7 @@
#include "cmValue.h" #include "cmValue.h"
cmTest::cmTest(cmMakefile* mf) cmTest::cmTest(cmMakefile* mf)
: CommandExpandLists(false) : Backtrace(mf->GetBacktrace())
, Backtrace(mf->GetBacktrace())
{ {
this->Makefile = mf; this->Makefile = mf;
this->OldStyle = true; this->OldStyle = true;

View File

@ -64,7 +64,7 @@ private:
cmPropertyMap Properties; cmPropertyMap Properties;
std::string Name; std::string Name;
std::vector<std::string> Command; std::vector<std::string> Command;
bool CommandExpandLists; bool CommandExpandLists = false;
bool OldStyle; bool OldStyle;

View File

@ -10,10 +10,6 @@ cmXMLWriter::cmXMLWriter(std::ostream& output, std::size_t level)
: Output(output) : Output(output)
, IndentationElement(1, '\t') , IndentationElement(1, '\t')
, Level(level) , Level(level)
, Indent(0)
, ElementOpen(false)
, BreakAttrib(false)
, IsContent(false)
{ {
} }

View File

@ -124,10 +124,10 @@ private:
std::stack<std::string, std::vector<std::string>> Elements; std::stack<std::string, std::vector<std::string>> Elements;
std::string IndentationElement; std::string IndentationElement;
std::size_t Level; std::size_t Level;
std::size_t Indent; std::size_t Indent = 0;
bool ElementOpen; bool ElementOpen = false;
bool BreakAttrib; bool BreakAttrib = false;
bool IsContent; bool IsContent = false;
}; };
class cmXMLElement; // IWYU pragma: keep class cmXMLElement; // IWYU pragma: keep

View File

@ -2069,8 +2069,8 @@ class cmVSLink
{ {
int Type; int Type;
bool Verbose; bool Verbose;
bool Incremental; bool Incremental = false;
bool LinkGeneratesManifest; bool LinkGeneratesManifest = true;
std::vector<std::string> LinkCommand; std::vector<std::string> LinkCommand;
std::vector<std::string> UserManifests; std::vector<std::string> UserManifests;
std::string LinkerManifestFile; std::string LinkerManifestFile;
@ -2085,8 +2085,6 @@ public:
cmVSLink(int type, bool verbose) cmVSLink(int type, bool verbose)
: Type(type) : Type(type)
, Verbose(verbose) , Verbose(verbose)
, Incremental(false)
, LinkGeneratesManifest(true)
{ {
} }
bool Parse(std::vector<std::string>::const_iterator argBeg, bool Parse(std::vector<std::string>::const_iterator argBeg,