aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Basic/FileManagerTest.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2022-12-20 00:15:11 +0100
committerBenjamin Kramer <benny.kra@googlemail.com>2022-12-20 00:41:40 +0100
commit854c10f8d185286d941307e1033eb492e085c203 (patch)
treed80b1b5ae1be07e2cbd1315f64e6ab2d36773847 /clang/unittests/Basic/FileManagerTest.cpp
parenteddb7280462ca316ba8d4d9fa6f175e8e2e65b72 (diff)
downloadllvm-854c10f8d185286d941307e1033eb492e085c203.zip
llvm-854c10f8d185286d941307e1033eb492e085c203.tar.gz
llvm-854c10f8d185286d941307e1033eb492e085c203.tar.bz2
[Clang] Prepare for llvm::Optional becoming std::optional.
The needed tweaks are mostly trivial, the one nasty bit is Clang's usage of OptionalStorage. To keep this working old Optional stays around as clang::CustomizableOptional, with the default Storage removed. Optional<File/DirectoryEntryRef> is replaced with a typedef. I tested this with GCC 7.5, the oldest supported GCC I had around. Differential Revision: https://reviews.llvm.org/D140332
Diffstat (limited to 'clang/unittests/Basic/FileManagerTest.cpp')
-rw-r--r--clang/unittests/Basic/FileManagerTest.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp
index 6fe4a3d..146a609 100644
--- a/clang/unittests/Basic/FileManagerTest.cpp
+++ b/clang/unittests/Basic/FileManagerTest.cpp
@@ -534,7 +534,7 @@ TEST_F(FileManagerTest, getBypassFile) {
// Calling a second time should not affect the UID or size.
unsigned VirtualUID = FE.getUID();
- llvm::Optional<FileEntryRef> SearchRef;
+ OptionalFileEntryRef SearchRef;
ASSERT_THAT_ERROR(Manager.getFileRef("/tmp/test").moveInto(SearchRef),
Succeeded());
EXPECT_EQ(&FE, &SearchRef->getFileEntry());
@@ -542,8 +542,7 @@ TEST_F(FileManagerTest, getBypassFile) {
EXPECT_EQ(FE.getSize(), 10);
// Bypass the file.
- llvm::Optional<FileEntryRef> BypassRef =
- Manager.getBypassFile(File->getLastRef());
+ OptionalFileEntryRef BypassRef = Manager.getBypassFile(File->getLastRef());
ASSERT_TRUE(BypassRef);
EXPECT_EQ("/tmp/test", BypassRef->getName());