[clang] [LifetimeSafety] Simplify `AccessPath` root `PointerUnion` (PR #193520)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 23 02:05:28 PDT 2026


usx95 wrote:

Actually AI review just gave me a better suggestion: 

```cpp
const clang::ValueDecl *getAsValueDecl() const {
  return K == Kind::ValueDecl 
    ? cast<clang::ValueDecl>(Root.get<const clang::Decl *>())
    : nullptr;
}
```

Let's do this instead of `dyn_cast`

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


More information about the cfe-commits mailing list