diff --git a/clang/include/clang/Analysis/Analyses/Consumed.h b/clang/include/clang/Analysis/Analyses/Consumed.h --- a/clang/include/clang/Analysis/Analyses/Consumed.h +++ b/clang/include/clang/Analysis/Analyses/Consumed.h @@ -244,7 +244,7 @@ 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 --- a/clang/include/clang/Parse/Parser.h +++ b/clang/include/clang/Parse/Parser.h @@ -1188,7 +1188,7 @@ /// 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 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -1294,7 +1294,7 @@ 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 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -232,7 +232,7 @@ /// 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 --- a/clang/lib/CodeGen/ConstantEmitter.h +++ b/clang/lib/CodeGen/ConstantEmitter.h @@ -42,7 +42,7 @@ /// 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 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -89,7 +89,7 @@ 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 --- a/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp @@ -184,7 +184,7 @@ 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 --- a/clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp @@ -61,7 +61,7 @@ public: STLAlgorithmModeling() = default; - bool AggressiveStdFindModeling; + bool AggressiveStdFindModeling = false; bool evalCall(const CallEvent &Call, CheckerContext &C) const; }; //