[PATCH] D50630: [AST] Update/correct the static_asserts for the bit-fields in Type

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 13 13:27:56 PDT 2018


riccibruno added a comment.

Also I don't understand to comment about the bit-fields of FunctionType fitting in the padding of Type:

If we have something like

  struct Base {
    void *p1;
    void *p2;
    unsigned x;
  };
  
  struct Der : Base {
    unsigned x;
  };

Then on my machine (64 bit linux) I get that

  sizeof(Base) == 24
  sizeof(Der) == 32

and not `sizeof(Der) == sizeof(Base)` like if the unsigned of `Der` was fitting into the padding of `Base`.


Repository:
  rC Clang

https://reviews.llvm.org/D50630





More information about the cfe-commits mailing list