erichkeane added inline comments.
================ Comment at: lib/AST/Type.cpp:2226 + Context.getFieldOffset(*Record->field_begin())); + for (const auto *Field : Record->fields()) { + if (!Field->getType().hasUniqueObjectRepresentations(Context)) ---------------- erichkeane wrote: > rnk wrote: > > What about base classes? I think that's where the padding detection is > > going to get wacky. =/ > Based on my reading of the RecordLayout stuff, the "getFieldOffset" should > take that into account, right? It seems that 'fields' contains all fields, > and thus should run through the offset of all of them, right? I'll add > another test that inherits from a Padded struct to verify (as well as one > that causes padding with the inheritence). @rnk: You're correct here I believe, I'm not properly checking the base class as I thought I was. I'll get a new patch later today. https://reviews.llvm.org/D39064 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits