Fix use-after-move in ClangBasicTests

llvm-svn: 367620
This commit is contained in:
Harlan Haskins 2019-08-01 21:50:16 +00:00
parent 7fee93ed59
commit 5341f79a90
1 changed files with 1 additions and 1 deletions

View File

@ -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);