vabridgers added inline comments.

================
Comment at: clang/test/Analysis/array-struct-region.c:362-366
+int array_struct_bitfield_1() {
+  BITFIELD_CAST ff = {0};
+  BITFIELD_CAST *pff = &ff;
+  return *((int *)pff + 1);
+}
----------------
steakhal wrote:
> ```lang=c
> void array_struct_bitfield_1() {
>   BITFIELD_CAST ff = {0};
>   BITFIELD_CAST *pff = &ff;
>   clang_analyzer_eval(*((int *)pff + 1) == 0); // expected-warning{{TRUE}}
>   ff.b[0] = 3;
>   clang_analyzer_eval(*((int *)pff + 1) == 3); // expected-warning{{TRUE}}
> }
> ```
Good suggestion, thanks. I'll add this and wait for another accept.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124349

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

Reply via email to