[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 25 12:29:48 PST 2025


================
@@ -1391,7 +1391,9 @@ class DeclContextLookupResult {
   const_iterator end() const { return iterator(); }
 
   bool empty() const { return Result.isNull();  }
-  bool isSingleResult() const { return Result.dyn_cast<NamedDecl*>(); }
+  bool isSingleResult() const {
+    return dyn_cast_if_present<NamedDecl *>(Result);
----------------
nikic wrote:

isa_if_present would be clearer here?

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


More information about the cfe-commits mailing list