[PATCH] D49227: Override a bit fields layout from an external source
    Richard Smith - zygoloid via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Thu Jul 12 16:51:34 PDT 2018
    
    
  
rsmith accepted this revision.
rsmith added inline comments.
This revision is now accepted and ready to land.
================
Comment at: test/CodeGenCXX/override-bit-field-layout.cpp:5-12
+struct S {
+  short a : 3;
+  short b : 5;
+};
+
+void use_structs() {
+  S ss[sizeof(S)];
----------------
Another relevant test:
```
struct T {
  virtual void f();
  short x : 3;
};
```
Because we don't do vfptr layout adjustments when using an external layout source, I think this would have put `x` at offset 0 instead of at offset 8 prior to your patch.
Repository:
  rC Clang
https://reviews.llvm.org/D49227
    
    
More information about the cfe-commits
mailing list