diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-03 12:14:19 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-03 12:14:19 -0800 |
commit | a41fbb1fc2126e9791fd0f159f21935f6c2f93c4 (patch) | |
tree | 0e29b7b2463872b19002197ec5797442c5bc0f10 /clang/unittests/Tooling/TransformerTest.cpp | |
parent | ab672e91737daa55f18662d569d8c1ae6e0b4dfe (diff) | |
download | llvm-a41fbb1fc2126e9791fd0f159f21935f6c2f93c4.zip llvm-a41fbb1fc2126e9791fd0f159f21935f6c2f93c4.tar.gz llvm-a41fbb1fc2126e9791fd0f159f21935f6c2f93c4.tar.bz2 |
[clang/unittests] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Diffstat (limited to 'clang/unittests/Tooling/TransformerTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/TransformerTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/unittests/Tooling/TransformerTest.cpp b/clang/unittests/Tooling/TransformerTest.cpp index 7367282..6d6ed33 100644 --- a/clang/unittests/Tooling/TransformerTest.cpp +++ b/clang/unittests/Tooling/TransformerTest.cpp @@ -110,18 +110,18 @@ protected: "clang-tool", std::make_shared<PCHContainerOperations>(), FileContents)) { llvm::errs() << "Running tool failed.\n"; - return None; + return std::nullopt; } if (ErrorCount != 0) { llvm::errs() << "Generating changes failed.\n"; - return None; + return std::nullopt; } auto ChangedCode = applyAtomicChanges("input.cc", Code, Changes, ApplyChangesSpec()); if (!ChangedCode) { llvm::errs() << "Applying changes failed: " << llvm::toString(ChangedCode.takeError()) << "\n"; - return None; + return std::nullopt; } return *ChangedCode; } |