aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/TransformerTest.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-01-14 12:31:01 -0800
committerKazu Hirata <kazu@google.com>2023-01-14 12:31:01 -0800
commit6ad0788c332bb2043142954d300c49ac3e537f34 (patch)
treea67542ce4ca8dbcc65ef3cd01e76ff9cb861208b /clang/unittests/Tooling/TransformerTest.cpp
parentff39b7ea89476c78177aff5cb0ddb441e74c8838 (diff)
downloadllvm-6ad0788c332bb2043142954d300c49ac3e537f34.zip
llvm-6ad0788c332bb2043142954d300c49ac3e537f34.tar.gz
llvm-6ad0788c332bb2043142954d300c49ac3e537f34.tar.bz2
[clang] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to remove #include "llvm/ADT/Optional.h". 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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/Tooling/TransformerTest.cpp b/clang/unittests/Tooling/TransformerTest.cpp
index 8d10f38..09fcf04 100644
--- a/clang/unittests/Tooling/TransformerTest.cpp
+++ b/clang/unittests/Tooling/TransformerTest.cpp
@@ -84,7 +84,7 @@ static std::string format(StringRef Code) {
}
static void compareSnippets(StringRef Expected,
- const llvm::Optional<std::string> &MaybeActual) {
+ const std::optional<std::string> &MaybeActual) {
ASSERT_TRUE(MaybeActual) << "Rewrite failed. Expecting: " << Expected;
auto Actual = *MaybeActual;
std::string HL = "#include \"header.h\"\n";
@@ -103,7 +103,7 @@ protected:
FileContents.emplace_back(std::string(Filename), std::string(Content));
}
- llvm::Optional<std::string> rewrite(StringRef Input) {
+ std::optional<std::string> rewrite(StringRef Input) {
std::string Code = ("#include \"header.h\"\n" + Input).str();
auto Factory = newFrontendActionFactory(&MatchFinder);
if (!runToolOnCodeWithArgs(