simon_tatham added inline comments.

================
Comment at: clang/include/clang/AST/DeclObjC.h:208
   const ParmVarDecl *const *getParams() const {
-    return reinterpret_cast<const ParmVarDecl *const *>(ParamsAndSelLocs);
+    return const_cast<const ParmVarDecl *const *>(Params);
   }
----------------
tmatheson wrote:
> I don't think you need the `const_cast`
I put it in because I got a compile error otherwise!

It's because of the double indirection. You don't need a cast to turn a `Foo *` 
into a `const Foo *`. But here, we're turning a `Foo *` into a `const Bar *`, 
where `Foo` and `Bar` are pointer types to things of different constness.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105498/new/

https://reviews.llvm.org/D105498

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to