[PATCH] D153276: [clang][Interp] Reject reinterpret_cast expressions

Paul Robinson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 8 09:47:23 PDT 2023


probinson added inline comments.


================
Comment at: clang/lib/AST/Interp/Interp.h:1761
+  S.FFDiag(Loc, diag::note_constexpr_invalid_cast)
+      << static_cast<uint8_t>(Kind) << S.Current->getRange(OpPC);
+  return false;
----------------
aaron.ballman wrote:
> tbaeder wrote:
> > probinson wrote:
> > > Would you mind changing this cast from `uint8_t` to `unsigned`? We have an internal bot using a pickier mode of MSVC and it complains about ambiguous overloads, as the `operator<<` doesn't have anything smaller than `int` and `unsigned`.
> > Feel free to push that change, I'm currently working on something else.
> Yeah, that's a perfectly reasonable NFC commit to make -- go for it!
https://github.com/llvm/llvm-project/commit/4e8cae4aec6590ca13ec65ed38d6da55c6031755



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153276



More information about the cfe-commits mailing list