[PATCH] D50163: [AST] Remove the static_assert check in ObjCMethodDecl::ObjCMethodDecl

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 2 08:56:44 PDT 2018


bricci added a comment.

The static_assert itself cannot be in the bitfield since the whole point is to avoid including Basic/IdentifierTable.h just for this.

I originally put the static_assert in ObjCMethodDecl and everything worked fine when tested with GCC but I then saw just
after you committed it that it broke some builds. Therefore for the moment I just removed it (and had to beg someone on IRC to commit it )

However  I think that we can simply add it to the definition of the class ObjCMethodDecl with a comment both in the bitfield
and in ObjCMethodDecl which explains why we checks this. The problem was not the location of the static_assert, but the fact that
even though the member ObjCMethodDeclBits is protected the nested class ObjCMethodDeclBitfields is private. However I think tha
we can just use something like

`static_assert(decltype(ObjCMethodDeclBits)::ObjCMethodFamilyBitWidth == ObjCMethodFamilyBitWidth, "blablabla")`


Repository:
  rC Clang

https://reviews.llvm.org/D50163





More information about the cfe-commits mailing list