diff options
author | Harlan Haskins <harlan@harlanhaskins.com> | 2019-08-01 21:50:16 +0000 |
---|---|---|
committer | Harlan Haskins <harlan@harlanhaskins.com> | 2019-08-01 21:50:16 +0000 |
commit | 5341f79a90bb17dede6c8581f596424c3f248060 (patch) | |
tree | 21310e64ce7eecc63e61c875e09fba7dc27b84c8 /clang/unittests/Basic/FileManagerTest.cpp | |
parent | 7fee93ed59fdc204c215639c028b561e56e685eb (diff) | |
download | llvm-5341f79a90bb17dede6c8581f596424c3f248060.zip llvm-5341f79a90bb17dede6c8581f596424c3f248060.tar.gz llvm-5341f79a90bb17dede6c8581f596424c3f248060.tar.bz2 |
Fix use-after-move in ClangBasicTests
llvm-svn: 367620
Diffstat (limited to 'clang/unittests/Basic/FileManagerTest.cpp')
-rw-r--r-- | clang/unittests/Basic/FileManagerTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp index cff12c53..77e1305 100644 --- a/clang/unittests/Basic/FileManagerTest.cpp +++ b/clang/unittests/Basic/FileManagerTest.cpp @@ -212,6 +212,7 @@ TEST_F(FileManagerTest, getFileReturnsErrorForNonexistentFile) { auto statCache = llvm::make_unique<FakeStatCache>(); statCache->InjectDirectory(".", 41); statCache->InjectFile("foo.cpp", 42); + statCache->InjectDirectory("MyDirectory", 49); manager.setStatCache(std::move(statCache)); // Create a virtual bar.cpp file. @@ -221,7 +222,6 @@ TEST_F(FileManagerTest, getFileReturnsErrorForNonexistentFile) { ASSERT_FALSE(file); ASSERT_EQ(file.getError(), std::errc::no_such_file_or_directory); - statCache->InjectDirectory("MyDirectory", 49); auto readingDirAsFile = manager.getFile("MyDirectory"); ASSERT_FALSE(readingDirAsFile); ASSERT_EQ(readingDirAsFile.getError(), std::errc::is_a_directory); |