aaron.ballman added inline comments.

================
Comment at: clang/lib/Sema/SemaChecking.cpp:17397
+      auto *MA = llvm::find(MisalignedMembers, MisalignedMember(Op));
+      const bool IsDiscardMisalignedPointer =
+          T->isPointerType() &&
----------------
We don't typically use top-level `const` qualification.


================
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);
----------------
Hmm, is this logic correct? Don't we want:

```
T->isDependentType() ||
  (T->isPointerType() &&
    (T->getPointeeType()->isIncompleteType() || 
Context.getTypeAlignInChars(T->getPointeeType()) <= MA->Alignment))
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136018

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to