ilya-biryukov added inline comments.
================ Comment at: lib/Sema/SemaDecl.cpp:12184 Decl *Sema::ActOnSkippedFunctionBody(Decl *Decl) { - if (FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(Decl)) + if (FunctionDecl *FD = Decl->getAsFunction()) FD->setHasSkippedBody(); ---------------- sepavloff wrote: > In the case of `Decl == nullptr` this code would crash. Probably it makes > sense to check for this condition at the beginning of the function and use > `dyn_cast` instead of `dyn_cast_or_null` in the next check. > Do we have callsites that pass null to this function? I don't see a meaningful semantics for this function if we pass null here. I thought that `Decl`s are always passed via pointers by convention, but I may be wrong. Repository: rC Clang https://reviews.llvm.org/D41237 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits