[clang] [AST] Migrate away from PointerUnion::get (NFC) (PR #119949)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 13 22:27:39 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

Note that PointerUnion::get has been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>


---
Full diff: https://github.com/llvm/llvm-project/pull/119949.diff


1 Files Affected:

- (modified) clang/unittests/AST/ASTImporterTest.cpp (+1-1) 


``````````diff
diff --git a/clang/unittests/AST/ASTImporterTest.cpp b/clang/unittests/AST/ASTImporterTest.cpp
index abf07d094e62c3..f3f314b723dfc6 100644
--- a/clang/unittests/AST/ASTImporterTest.cpp
+++ b/clang/unittests/AST/ASTImporterTest.cpp
@@ -9657,7 +9657,7 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportConflictTypeAliasTemplate) {
 AST_MATCHER(ClassTemplateSpecializationDecl, hasInstantiatedFromMember) {
   if (auto Instantiate = Node.getInstantiatedFrom()) {
     if (auto *FromPartialSpecialization =
-            Instantiate.get<ClassTemplatePartialSpecializationDecl *>()) {
+            cast<ClassTemplatePartialSpecializationDecl *>(Instantiate)) {
       return nullptr != FromPartialSpecialization->getInstantiatedFromMember();
     }
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/119949


More information about the cfe-commits mailing list