[clang-tools-extra] c8942c6 - [clang-tidy] Use llvm::transformOptional (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 14 18:27:50 PST 2022
Author: Kazu Hirata
Date: 2022-12-14T18:27:39-08:00
New Revision: c8942c643f7849e8f3aeeb1e6b06388888ba7590
URL: https://github.com/llvm/llvm-project/commit/c8942c643f7849e8f3aeeb1e6b06388888ba7590
DIFF: https://github.com/llvm/llvm-project/commit/c8942c643f7849e8f3aeeb1e6b06388888ba7590.diff
LOG: [clang-tidy] Use llvm::transformOptional (NFC)
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
Added:
Modified:
clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp
index 90c1f7ecdc0ec..71c7daaf7c1ee 100644
--- a/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp
@@ -130,9 +130,9 @@ getFailureInfoImpl(StringRef Name, bool IsInGlobalNamespace,
}
};
auto InProgressFixup = [&] {
- return Info
- .transform(
- [](const FailureInfo &Info) { return StringRef(Info.Fixup); })
+ return llvm::transformOptional(
+ Info,
+ [](const FailureInfo &Info) { return StringRef(Info.Fixup); })
.value_or(Name);
};
if (auto Fixup = getDoubleUnderscoreFixup(InProgressFixup(), LangOpts))
More information about the cfe-commits
mailing list