[PATCH] D139513: [ADT] Use std::nullopt instead of llvm::None in OptionalTest.cpp
Kazu Hirata via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 00:05:00 PST 2022
kazu created this revision.
Herald added a project: All.
kazu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch updates the test for the streaming operator for
llvm::Optional to use std::nullopt instead of llvm::None.
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
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D139513
Files:
llvm/unittests/ADT/OptionalTest.cpp
Index: llvm/unittests/ADT/OptionalTest.cpp
===================================================================
--- llvm/unittests/ADT/OptionalTest.cpp
+++ llvm/unittests/ADT/OptionalTest.cpp
@@ -813,16 +813,17 @@
TEST(OptionalTest, UseInUnitTests) {
// Test that we invoke the streaming operators when pretty-printing values in
// EXPECT macros.
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(llvm::None, ComparableAndStreamable::get()),
- "Expected equality of these values:\n"
- " llvm::None\n"
- " Which is: None\n"
- " ComparableAndStreamable::get()\n"
- " Which is: ComparableAndStreamable");
+ EXPECT_NONFATAL_FAILURE(
+ EXPECT_EQ(std::nullopt, ComparableAndStreamable::get()),
+ "Expected equality of these values:\n"
+ " std::nullopt\n"
+ " Which is: None\n"
+ " ComparableAndStreamable::get()\n"
+ " Which is: ComparableAndStreamable");
// Test that it is still possible to compare objects which do not have a
// custom streaming operator.
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(llvm::None, Comparable::get()), "object");
+ EXPECT_NONFATAL_FAILURE(EXPECT_EQ(std::nullopt, Comparable::get()), "object");
}
TEST(OptionalTest, HashValue) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139513.480791.patch
Type: text/x-patch
Size: 1326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221207/9dd6c1d5/attachment-0001.bin>
More information about the llvm-commits
mailing list