[clang] 9b050e5 - [clang] Remove redundant initialization of std::optional (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 22 13:46:32 PST 2022
Author: Kazu Hirata
Date: 2022-12-22T13:46:26-08:00
New Revision: 9b050e5011e92be1b953cc1cc1406cfbcb43fb90
URL: https://github.com/llvm/llvm-project/commit/9b050e5011e92be1b953cc1cc1406cfbcb43fb90
DIFF: https://github.com/llvm/llvm-project/commit/9b050e5011e92be1b953cc1cc1406cfbcb43fb90.diff
LOG: [clang] Remove redundant initialization of std::optional (NFC)
Added:
Modified:
clang/lib/APINotes/APINotesYAMLCompiler.cpp
clang/lib/Analysis/UnsafeBufferUsage.cpp
Removed:
################################################################################
diff --git a/clang/lib/APINotes/APINotesYAMLCompiler.cpp b/clang/lib/APINotes/APINotesYAMLCompiler.cpp
index d3e53c4dd191f..ff94f61940bfb 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<bool> SwiftInferImportAsMember = std::nullopt;
+ std::optional<bool> 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 88d6ca3eaf0c5..7de2de1c84bc2 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<FixItList> Fixes = std::nullopt;
+ std::optional<FixItList> Fixes;
// Avoid suggesting fixes if not all uses of the variable are identified
// as known gadgets.
More information about the cfe-commits
mailing list