From: Simon Pilgrim Date: Sun, 14 Jul 2019 19:13:09 +0000 (+0000) Subject: Fix uninitialized variable analyzer warning. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=675857ee3eeaaaeb6f43ed78fa7f9a34c06c21dc;p=clang Fix uninitialized variable analyzer warning. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366029 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 1324abb04a..ee7950de45 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -12192,7 +12192,7 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { // Cache the result of checking for constant initialization. Optional CacheHasConstInit; - const Expr *CacheCulprit; + const Expr *CacheCulprit = nullptr; auto checkConstInit = [&]() mutable { if (!CacheHasConstInit) CacheHasConstInit = var->getInit()->isConstantInitializer(