[PATCH] D26664: [ObjC] Prevent infinite loops when iterating over redeclaration of a method that was declared in an invalid interface

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 15 09:15:11 PST 2016


arphaman added inline comments.


================
Comment at: lib/AST/DeclObjC.cpp:841
+    return nullptr;
+  if (const auto *Ctx = cast<Decl>(Redecl->getDeclContext()))
+    if (Ctx->isInvalidDecl())
----------------
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`.


Repository:
  rL LLVM

https://reviews.llvm.org/D26664





More information about the cfe-commits mailing list