[PATCH] D78767: [Sema] Teach -Wcast-align to compute a more accurate alignment when the source expression has array subscript or pointer arithmetic operators
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 12 12:54:54 PDT 2020
rjmccall added inline comments.
================
Comment at: clang/lib/Sema/SemaChecking.cpp:13111
+ }
+ }
+ return std::make_tuple(false, CharUnits::Zero(), CharUnits::Zero());
----------------
ahatanak wrote:
> rjmccall wrote:
> > Derived-to-base conversions.
> Does this include cases where bases are virtual? I think that would be more complex as it requires tracking the most-derived object. Do you think it's important to handle virtual bases in this patch or should it be done separately in a follow-up?
You should handle virtual bases, but it's okay to assume they're not within known-complete objects; i.e. you just need to reset the alignment to the alignment of the base.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78767/new/
https://reviews.llvm.org/D78767
More information about the cfe-commits
mailing list