From 9b050e5011e92be1b953cc1cc1406cfbcb43fb90 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 22 Dec 2022 13:46:26 -0800 Subject: [PATCH] [clang] Remove redundant initialization of std::optional (NFC) --- clang/lib/APINotes/APINotesYAMLCompiler.cpp | 2 +- clang/lib/Analysis/UnsafeBufferUsage.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/APINotes/APINotesYAMLCompiler.cpp b/clang/lib/APINotes/APINotesYAMLCompiler.cpp index d3e53c4..ff94f61 100644 --- a/clang/lib/APINotes/APINotesYAMLCompiler.cpp +++ b/clang/lib/APINotes/APINotesYAMLCompiler.cpp @@ -549,7 +549,7 @@ struct Module { TopLevelItems TopLevel; VersionedSeq SwiftVersions; - std::optional SwiftInferImportAsMember = std::nullopt; + std::optional SwiftInferImportAsMember; #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void dump() /*const*/; diff --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp index 88d6ca3..7de2de1 100644 --- a/clang/lib/Analysis/UnsafeBufferUsage.cpp +++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp @@ -427,7 +427,7 @@ void clang::checkUnsafeBufferUsage(const Decl *D, if (!any_of(VDGadgets, [](const Gadget *G) { return !G->isSafe(); })) continue; - std::optional Fixes = std::nullopt; + std::optional Fixes; // Avoid suggesting fixes if not all uses of the variable are identified // as known gadgets. -- 2.7.4