[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

Max Bernstein via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 22 11:33:26 PDT 2018


tekknolagi added inline comments.


================
Comment at: test/Analysis/padding_cpp.cpp:204-212
+// expected-warning at +1{{Excessive padding in 'struct FakeIntSandwich'}}
+struct FakeIntSandwich {
+  char c1;
+  int i;
+  char c2;
+};
+
----------------
bcraig wrote:
> Looking at this again... what new cases does this catch?  FakeIntSandwich was caught before (it is identical to 'PaddedA', and AnotherIntSandwich generated no warning before.  So what is different?
> 
> EBO1 and EBO2 are cases above that would be nice to catch, but aren't being caught right now.
Ah, you're right. I'll just keep the one in `padding_inherit`.


Repository:
  rC Clang

https://reviews.llvm.org/D53206





More information about the cfe-commits mailing list