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)
: repository(r)
, xout(x)
, patched(false)
{
}
cmCPackIFWRepository* repository;
cmXMLWriter& xout;
bool patched;
bool patched = false;
protected:
void StartElement(const std::string& name, const char** atts) override

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,13 +23,6 @@ using namespace cmFSPermissions;
cmFileInstaller::cmFileInstaller(cmExecutionStatus& status)
: 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.
this->UseSourcePermissions = false;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,5 +26,5 @@ private:
std::vector<cmGeneratorExpressionToken>::const_iterator it;
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)
: 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->LocalGenerator = lg;
@ -2775,15 +2761,14 @@ cmGeneratorTarget::LinkClosure const* cmGeneratorTarget::GetLinkClosure(
class cmTargetSelectLinker
{
int Preference;
int Preference = 0;
cmGeneratorTarget const* Target;
cmGlobalGenerator* GG;
std::set<std::string> Preferred;
public:
cmTargetSelectLinker(cmGeneratorTarget const* target)
: Preference(0)
, Target(target)
: Target(target)
{
this->GG = this->Target->GetLocalGenerator()->GetGlobalGenerator();
}

View File

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

View File

@ -109,18 +109,6 @@ cmGraphVizWriter::cmGraphVizWriter(std::string const& fileName,
, GraphHeader("node [\n fontsize = \"12\"\n];")
, GraphNodePrefix("node")
, 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;
int NextNodeId;
int NextNodeId = 0;
// maps from the actual item names to node names in dot:
std::map<std::string, std::string> NodeNames;
bool GenerateForExecutables;
bool GenerateForStaticLibs;
bool GenerateForSharedLibs;
bool GenerateForModuleLibs;
bool GenerateForInterfaceLibs;
bool GenerateForObjectLibs;
bool GenerateForUnknownLibs;
bool GenerateForCustomTargets;
bool GenerateForExternals;
bool GeneratePerTarget;
bool GenerateDependers;
bool GenerateForExecutables = true;
bool GenerateForStaticLibs = true;
bool GenerateForSharedLibs = true;
bool GenerateForModuleLibs = true;
bool GenerateForInterfaceLibs = true;
bool GenerateForObjectLibs = true;
bool GenerateForUnknownLibs = true;
bool GenerateForCustomTargets = false;
bool GenerateForExternals = true;
bool GeneratePerTarget = true;
bool GenerateDependers = true;
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -65,5 +65,5 @@ private:
cmGeneratorTarget* GT;
cmMakefile* Makefile;
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)
: StateSnapshot(snapshot)
, LinkScriptShell(false)
{
assert(this->StateSnapshot.IsValid());
this->ComputeRelativePathTopSource();

View File

@ -138,7 +138,7 @@ private:
static bool Shell_ArgumentNeedsQuotes(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
// source and destination location of a relative path conversion

View File

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

View File

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

View File

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

View File

@ -78,12 +78,12 @@ protected:
// Information used during generation.
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
// configuration. False if the subclass only generates one rule for
// all enabled configurations.
bool ActionsPerConfig;
bool ActionsPerConfig = false;
private:
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
// mutable members to achieve a map with set syntax.
mutable bool Link;
mutable bool Util;
mutable bool Cross;
mutable bool Link = false;
mutable bool Util = false;
mutable bool Cross = false;
mutable cmListFileBacktrace Backtrace;
public:
cmTargetDepend(cmGeneratorTarget const* t)
: Target(t)
, Link(false)
, Util(false)
, Cross(false)
{
}
operator cmGeneratorTarget const*() const { return this->Target; }

View File

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

View File

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

View File

@ -10,10 +10,6 @@ cmXMLWriter::cmXMLWriter(std::ostream& output, std::size_t level)
: Output(output)
, IndentationElement(1, '\t')
, 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::string IndentationElement;
std::size_t Level;
std::size_t Indent;
bool ElementOpen;
bool BreakAttrib;
bool IsContent;
std::size_t Indent = 0;
bool ElementOpen = false;
bool BreakAttrib = false;
bool IsContent = false;
};
class cmXMLElement; // IWYU pragma: keep

View File

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