r366029 - Fix uninitialized variable analyzer warning. NFCI.

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 14 12:13:10 PDT 2019


Author: rksimon
Date: Sun Jul 14 12:13:09 2019
New Revision: 366029

URL: http://llvm.org/viewvc/llvm-project?rev=366029&view=rev
Log:
Fix uninitialized variable analyzer warning. NFCI.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=366029&r1=366028&r2=366029&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sun Jul 14 12:13:09 2019
@@ -12192,7 +12192,7 @@ void Sema::CheckCompleteVariableDeclarat
 
   // Cache the result of checking for constant initialization.
   Optional<bool> CacheHasConstInit;
-  const Expr *CacheCulprit;
+  const Expr *CacheCulprit = nullptr;
   auto checkConstInit = [&]() mutable {
     if (!CacheHasConstInit)
       CacheHasConstInit = var->getInit()->isConstantInitializer(




More information about the cfe-commits mailing list