diff options
Diffstat (limited to 'clang/unittests/Sema/ExternalSemaSourceTest.cpp')
-rw-r--r-- | clang/unittests/Sema/ExternalSemaSourceTest.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/clang/unittests/Sema/ExternalSemaSourceTest.cpp b/clang/unittests/Sema/ExternalSemaSourceTest.cpp index cc9dd41..2524ac3 100644 --- a/clang/unittests/Sema/ExternalSemaSourceTest.cpp +++ b/clang/unittests/Sema/ExternalSemaSourceTest.cpp @@ -181,7 +181,7 @@ public: // performing semantic analysis. class ExternalSemaSourceInstaller : public clang::ASTFrontendAction { std::vector<DiagnosticWatcher *> Watchers; - std::vector<clang::ExternalSemaSource *> Sources; + std::vector<llvm::IntrusiveRefCntPtr<clang::ExternalSemaSource>> Sources; std::unique_ptr<DiagnosticConsumer> OwnedClient; protected: @@ -212,8 +212,8 @@ protected: } public: - void PushSource(clang::ExternalSemaSource *Source) { - Sources.push_back(Source); + void PushSource(llvm::IntrusiveRefCntPtr<clang::ExternalSemaSource> Source) { + Sources.push_back(std::move(Source)); } void PushWatcher(DiagnosticWatcher *Watcher) { Watchers.push_back(Watcher); } @@ -238,7 +238,7 @@ TEST(ExternalSemaSource, ExternalTypoCorrectionPrioritized) { auto Installer = std::make_unique<ExternalSemaSourceInstaller>(); auto Provider = makeIntrusiveRefCnt<NamespaceTypoProvider>("AAB", "BBB"); DiagnosticWatcher Watcher("AAB", "BBB"); - Installer->PushSource(Provider.get()); + Installer->PushSource(Provider); Installer->PushWatcher(&Watcher); std::vector<std::string> Args(1, "-std=c++11"); ASSERT_TRUE(clang::tooling::runToolOnCodeWithArgs( @@ -255,9 +255,9 @@ TEST(ExternalSemaSource, ExternalTypoCorrectionOrdering) { auto Second = makeIntrusiveRefCnt<NamespaceTypoProvider>("AAB", "CCC"); auto Third = makeIntrusiveRefCnt<NamespaceTypoProvider>("AAB", "DDD"); DiagnosticWatcher Watcher("AAB", "CCC"); - Installer->PushSource(First.get()); - Installer->PushSource(Second.get()); - Installer->PushSource(Third.get()); + Installer->PushSource(First); + Installer->PushSource(Second); + Installer->PushSource(Third); Installer->PushWatcher(&Watcher); std::vector<std::string> Args(1, "-std=c++11"); ASSERT_TRUE(clang::tooling::runToolOnCodeWithArgs( @@ -273,7 +273,7 @@ TEST(ExternalSemaSource, ExternalTypoCorrectionOrdering) { TEST(ExternalSemaSource, TryOtherTacticsBeforeDiagnosing) { auto Installer = std::make_unique<ExternalSemaSourceInstaller>(); auto Diagnoser = makeIntrusiveRefCnt<CompleteTypeDiagnoser>(false); - Installer->PushSource(Diagnoser.get()); + Installer->PushSource(Diagnoser); std::vector<std::string> Args(1, "-std=c++11"); // This code hits the class template specialization/class member of a class // template specialization checks in Sema::RequireCompleteTypeImpl. @@ -291,9 +291,9 @@ TEST(ExternalSemaSource, FirstDiagnoserTaken) { auto First = makeIntrusiveRefCnt<CompleteTypeDiagnoser>(false); auto Second = makeIntrusiveRefCnt<CompleteTypeDiagnoser>(true); auto Third = makeIntrusiveRefCnt<CompleteTypeDiagnoser>(true); - Installer->PushSource(First.get()); - Installer->PushSource(Second.get()); - Installer->PushSource(Third.get()); + Installer->PushSource(First); + Installer->PushSource(Second); + Installer->PushSource(Third); std::vector<std::string> Args(1, "-std=c++11"); ASSERT_FALSE(clang::tooling::runToolOnCodeWithArgs( std::move(Installer), "class Incomplete; Incomplete IncompleteInstance;", |