================
@@ -243,7 +243,7 @@ class TypeLoc {
 
 inline TypeSourceInfo::TypeSourceInfo(QualType ty, size_t DataSize) : Ty(ty) {
   // Init data attached to the object. See getTypeLoc.
-  memset(this + 1, 0, DataSize);
+  memset(const_cast<void *>(static_cast<const void *>(this + 1)), 0, DataSize);
----------------
bonktree wrote:

My intention here was to match the double cast in `::getTypeLoc()`, so the way 
this memory is referenced is the same throughout the impls.

I've just tested the single cast, and it does not trigger the warning as well. 
Will amend my patch then.

https://github.com/llvm/llvm-project/pull/68435
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to