royjacobson marked an inline comment as done.
royjacobson added inline comments.


================
Comment at: clang/test/SemaCXX/type-traits.cpp:2886-2889
+struct UnnamedEmptyBitfield {
+  int named;
+  int : 0;
+};
----------------
shafik wrote:
> aaron.ballman wrote:
> > I think there's one more test to add:
> > ```
> > struct UnnamedEmptyBitfieldSplit {
> >   short named;
> >   int : 0;
> >   short also_named;
> > };
> > static_assert(sizeof(UnnamedEmptyBitfieldSplit) != (sizeof(short) * 2));
> > static_assert(!has_unique_object_representations<UnnamedEmptyBitfieldSplit>::value,
> >  "Bitfield padding");
> > ```
> Do we also want to check packed structs as well?
Do you have a test case where it would matter? Apparently `packed` is specified 
to ignore zero width bit fields.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145852

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

Reply via email to