arphaman added inline comments.
================ Comment at: lib/AST/DeclObjC.cpp:841 + return nullptr; + if (const auto *Ctx = cast<Decl>(Redecl->getDeclContext())) + if (Ctx->isInvalidDecl()) ---------------- erik.pilkington wrote: > arphaman wrote: > > mehdi_amini wrote: > > > Either you should use `dyn_cast`, or you should just `cast` but without a > > > `if` > > Thanks! Yeah, this is supposed to be `dyn_cast`. > Why `dyn_cast`? Can't we bank on a DeclContext being a Decl? I think you're right, I just need a `cast` without an `if` since `DeclContext` subclasses are all `Decl`s. ================ Comment at: lib/AST/DeclObjC.cpp:888 } if (!Redecl && isRedeclaration()) { ---------------- erik.pilkington wrote: > Do you think it would be cleaner to just do the check once here, if Redecl is > non-null? Yes, that would be neater. Thanks for the suggestion! Repository: rL LLVM https://reviews.llvm.org/D26664 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits