This is an archive of the discontinued LLVM Phabricator instance.

[AST] Remove the static_assert check in ObjCMethodDecl::ObjCMethodDecl
ClosedPublic

Authored by bricci on Aug 1 2018, 3:24 PM.

Diff Detail

Repository
rC Clang

Event Timeline

bricci created this revision.Aug 1 2018, 3:24 PM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 1 2018, 3:41 PM
This revision was automatically updated to reflect the committed changes.

@bricci : This likely needs to be moved into the bitfield section I think. We had a couple of other static-asserts that moved, so this is likely one of them.

bricci added a comment.EditedAug 2 2018, 8:56 AM

@erichkeane

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 just 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 )

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. Therefore I used ObjCMethodDeclBits.ObjCMethodFamilyBitWidth which was fine with GCC but not with clang. Unfortunately I did everything with GCC and thus this slipped through. However I think that we can just use something like

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

with a comment both in the bitfield and in ObjCMethodDecl explaining why we check this.