[PATCH] D55862: [Sema] Don't try to account for the size of an incomplete type in CheckArrayAccess

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 19 01:39:05 PST 2018


riccibruno added inline comments.


================
Comment at: test/SemaCXX/array-bounds.cpp:294
+  C &f() { return reinterpret_cast<C *>(xxx)[1]; } // no-warning
+  C &g() { return reinterpret_cast<C *>(xxx)[2]; } // expected-warning {{array index 2 is past the end of the array (which contains 2 elements)}}
+}
----------------
efriedma wrote:
> Not sure it actually makes sense to print a diagnostic here... at least, not this diagnostic.  We don't know whether the result here is actually out of bounds.
Right. I think that the right thing to do then is to not print anything
since we really don't have any information about whether this
is out of bounds.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55862





More information about the cfe-commits mailing list