shafik added inline comments.
================
Comment at: clang/lib/Sema/SemaChecking.cpp:17398-17399
+ const bool IsDiscardMisalignedPointer =
+ T->isPointerType() &&
+ (T->getPointeeType()->isIncompleteType() || T->isDependentType() ||
+ Context.getTypeAlignInChars(T->getPointeeType()) <= MA->Alignment);
----------------
aaron.ballman wrote:
> Hmm, is this logic correct? Don't we want:
>
> ```
> T->isDependentType() ||
> (T->isPointerType() &&
> (T->getPointeeType()->isIncompleteType() ||
> Context.getTypeAlignInChars(T->getPointeeType()) <= MA->Alignment))
> ```
Why did you drop the `T->isIntegerType()`?
================
Comment at: clang/test/SemaCXX/misaligned-member-with-depdent-type.cpp:4
+// expected-no-diagnostics
+struct __attribute__((packed)) {
+ unsigned options;
----------------
I think since the bug report had malformed code, it would be worth it to
include that case as well.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136018/new/
https://reviews.llvm.org/D136018
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits