[PATCH] D78767: [Sema] Teach -Wcast-align to compute a more accurate alignment when the source expression has array subscript or pointer arithmetic operators

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 23 15:47:54 PDT 2020


ahatanak created this revision.
ahatanak added reviewers: arphaman, erik.pilkington, rjmccall.
ahatanak added a project: clang.
Herald added subscribers: ributzka, dexonsmith, jkorous.

This improves upon https://reviews.llvm.org/D21099, which taught -Wcast-align to look at the aligned attribute of variables. I added a function that computes a more accurate alignment to `ExprConstant.cpp`.

rdar://problem/59242343


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78767

Files:
  clang/include/clang/AST/Expr.h
  clang/lib/AST/ExprConstant.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/test/Sema/warn-cast-align.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78767.259739.patch
Type: text/x-patch
Size: 4102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200423/d12625eb/attachment.bin>


More information about the cfe-commits mailing list