diff --git a/clang/include/clang/Analysis/Analyses/Consumed.h b/clang/include/clang/Analysis/Analyses/Consumed.h index 7da4f75ecc027..3e2788cac3c9c 100644 --- a/clang/include/clang/Analysis/Analyses/Consumed.h +++ b/clang/include/clang/Analysis/Analyses/Consumed.h @@ -244,7 +244,7 @@ namespace consumed { ConsumedBlockInfo BlockInfo; std::unique_ptr CurrStates; - ConsumedState ExpectedReturnState; + ConsumedState ExpectedReturnState = CS_None; void determineExpectedReturnState(AnalysisDeclContext &AC, const FunctionDecl *D); diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h index 84669e68a696a..c706482aec983 100644 --- a/clang/include/clang/Parse/Parser.h +++ b/clang/include/clang/Parse/Parser.h @@ -1188,7 +1188,7 @@ class Parser : public CodeCompletionHandler { /// RAII object used to modify the scope flags for the current scope. class ParseScopeFlags { Scope *CurScope; - unsigned OldFlags; + unsigned OldFlags = 0; ParseScopeFlags(const ParseScopeFlags &) = delete; void operator=(const ParseScopeFlags &) = delete; diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 8b1e59f13d1f3..d108a58a2ed66 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -1294,7 +1294,7 @@ namespace { class SpeculativeEvaluationRAII { EvalInfo *Info = nullptr; Expr::EvalStatus OldStatus; - unsigned OldSpeculativeEvaluationDepth; + unsigned OldSpeculativeEvaluationDepth = 0; void moveFromAndCancel(SpeculativeEvaluationRAII &&Other) { Info = Other.Info; diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index bd27642867719..b1164dc3f7290 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -232,7 +232,7 @@ class CGOpenMPRuntime { /// as those marked as `omp declare target`. class DisableAutoDeclareTargetRAII { CodeGenModule &CGM; - bool SavedShouldMarkAsGlobal; + bool SavedShouldMarkAsGlobal = false; public: DisableAutoDeclareTargetRAII(CodeGenModule &CGM); diff --git a/clang/lib/CodeGen/ConstantEmitter.h b/clang/lib/CodeGen/ConstantEmitter.h index 1a7a181ca7f03..a55da0dcad792 100644 --- a/clang/lib/CodeGen/ConstantEmitter.h +++ b/clang/lib/CodeGen/ConstantEmitter.h @@ -42,7 +42,7 @@ class ConstantEmitter { /// The AST address space where this (non-abstract) initializer is going. /// Used for generating appropriate placeholders. - LangAS DestAddressSpace; + LangAS DestAddressSpace = LangAS::Default; llvm::SmallVector, 4> PlaceholderAddresses; diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 2c1c43dad1603..2f052a5817a6f 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -89,7 +89,7 @@ namespace clang { using RecordData = ASTReader::RecordData; TypeID DeferredTypeID = 0; - unsigned AnonymousDeclNumber; + unsigned AnonymousDeclNumber = 0; GlobalDeclID NamedDeclForTagDecl = 0; IdentifierInfo *TypedefNameForLinkage = nullptr; diff --git a/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp index c8ddf3b2c14f1..ada802394758d 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp @@ -184,7 +184,7 @@ class MoveChecker bool Found; }; - AggressivenessKind Aggressiveness; + AggressivenessKind Aggressiveness = AK_KnownsAndLocals; public: void setAggressiveness(StringRef Str, CheckerManager &Mgr) { diff --git a/clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp b/clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp index e9d5d306cc06b..788f2875863c3 100644 --- a/clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp @@ -61,7 +61,7 @@ class STLAlgorithmModeling : public Checker { public: STLAlgorithmModeling() = default; - bool AggressiveStdFindModeling; + bool AggressiveStdFindModeling = false; bool evalCall(const CallEvent &Call, CheckerContext &C) const; }; //