[clang] Remove redundant initialization of std::optional (NFC)
authorKazu Hirata <kazu@google.com>
Thu, 22 Dec 2022 21:46:26 +0000 (13:46 -0800)
committerKazu Hirata <kazu@google.com>
Thu, 22 Dec 2022 21:46:26 +0000 (13:46 -0800)
clang/lib/APINotes/APINotesYAMLCompiler.cpp
clang/lib/Analysis/UnsafeBufferUsage.cpp

index d3e53c4..ff94f61 100644 (file)
@@ -549,7 +549,7 @@ struct Module {
   TopLevelItems TopLevel;
   VersionedSeq SwiftVersions;
 
-  std::optional<bool> SwiftInferImportAsMember = std::nullopt;
+  std::optional<bool> SwiftInferImportAsMember;
 
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
   LLVM_DUMP_METHOD void dump() /*const*/;
index 88d6ca3..7de2de1 100644 (file)
@@ -427,7 +427,7 @@ void clang::checkUnsafeBufferUsage(const Decl *D,
     if (!any_of(VDGadgets, [](const Gadget *G) { return !G->isSafe(); }))
       continue;
 
-    std::optional<FixItList> Fixes = std::nullopt;
+    std::optional<FixItList> Fixes;
 
     // Avoid suggesting fixes if not all uses of the variable are identified
     // as known gadgets.