This revision was automatically updated to reflect the committed changes.
Closed by commit rL352239: [Sema] Improve a -Warray-bounds diagnostic (authored
by epilk, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
aaron.ballman added inline comments.
Comment at: clang/include/clang/AST/ASTContext.h:2092
+ Optional getTypeSizeInCharsIfKnown(QualType Ty) const {
+if (Ty->isIncompleteType() || Ty->isDependentType())
+ return None;
erik.pilkington wrote:
>
erik.pilkington marked an inline comment as done.
erik.pilkington added inline comments.
Comment at: clang/include/clang/AST/ASTContext.h:2092
+ Optional getTypeSizeInCharsIfKnown(QualType Ty) const {
+if (Ty->isIncompleteType() || Ty->isDependentType())
+ return None;
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM with a testing request and some small nits.
Comment at: clang/include/clang/AST/ASTContext.h:2092
+ Optional getTypeSizeInCharsIfKnown(QualType Ty) const
erik.pilkington created this revision.
erik.pilkington added reviewers: aaron.ballman, rsmith.
Herald added subscribers: dexonsmith, jkorous.
Fix a bug where we would compare array sizes with incompatible element types,
and look through explicit casts.
rdar://44800168
Thanks for taking a look!