[clang] [Clang][NFC] Add nullptr check in InitializationSequence::InitializeFrom (PR #143067)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 6 07:48:39 PDT 2025


shafik wrote:

> If this were a bug, I suspect it would have been reported. Most likely, `dyn_cast_or_null<VarDecl>(Entity.getDecl());` is never null, and could be replaced by `cast`? Did you try that?

It could but that feel like a weak argument, I would like something stronger.

We do `dyn_cast_or_null<VarDecl>(...->getDecl())` in a lot of place, maybe it is cargo culting and it is not needed but I can't really tell.

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


More information about the cfe-commits mailing list