[PATCH] D71827: [clang] avoid strict aliasing violation in assert

Ryan Libby via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 9 11:29:42 PST 2020


rlibby added a comment.

I am no expert here so I will defer, but I believe those suggestions are weaker assertions.

I believe it's really trying to assert that the NamedDecl type is the first template type in the point union, and is represented by a 0 bit in the addr, and that the pointer was appropriately aligned.  So I tried to
choose something that would fail if those were not true.  I think that the dyn_cast<> approach will not fail appropriately if the NamedDecl type is not first.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71827





More information about the cfe-commits mailing list