[Sema] Teach -Wcast-align to compute an accurate alignment using the
authorAkira Hatanaka <ahatanaka@apple.com>
Mon, 23 Mar 2020 06:47:01 +0000 (23:47 -0700)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 15 May 2020 07:59:03 +0000 (00:59 -0700)
commit854f5f332af4640d9425e9a94442629e4f5a3f98
tree13dc8d9a199467121ea6420f0035cd9d7cb799c4
parentf58e78f9920531f85d98e8041f6967eeb1bd0d3a
[Sema] Teach -Wcast-align to compute an accurate alignment using the
alignment information on VarDecls in more cases

This commit improves upon https://reviews.llvm.org/D21099. The code that
computes the source alignment now understands array subscript
expressions, binary operators, derived-to-base casts, and several more
expressions.

rdar://problem/59242343

Differential Revision: https://reviews.llvm.org/D78767
clang/lib/Sema/SemaChecking.cpp
clang/test/SemaCXX/warn-cast-align.cpp