aaron.ballman added a comment.

Generally looks correct to me.



================
Comment at: clang/lib/AST/Interp/PrimType.h:65
 
+constexpr bool aligned(size_t Size) { return Size == align(Size); }
+static_assert(aligned(sizeof(void *)));
----------------
I think `Size` should be something more like `Value` -- I was thrown off by the 
pointer-based `aligned` that was treating the pointer as an integer value for 
`Size`. :-D


================
Comment at: clang/lib/AST/Interp/PrimType.h:69
+static inline bool aligned(const void *P) {
+  return aligned(reinterpret_cast<size_t>(P));
+}
----------------
Pedantically, this should be casting through `uintptr_t` rather than `size_t`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139185

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

Reply via email to