[cfe-dev] Static Assertions inside VarDecl constructor
David Majnemer
david.majnemer at gmail.com
Thu Jun 4 17:31:42 PDT 2015
On Tue, Jun 2, 2015 at 9:24 AM, Amila Jayasekara <thejaka.amila at gmail.com>
wrote:
> Hello,
>
> Inside VarDecl constructor (Decl.cpp L1721 in Clang 3.6) there are 2
> static assertions as follows;
>
> VarDecl::VarDecl(Kind DK, ASTContext &C, DeclContext *DC,...) {
>
> static_assert(sizeof(VarDeclBitfields) <= sizeof(unsigned),
> "VarDeclBitfields too large!");
> static_assert(sizeof(ParmVarDeclBitfields) <= sizeof(unsigned),
> "ParmVarDeclBitfields too large!");
> ...
> }
>
> I am trying to add an another field to VarDeclBitfields and it triggers
> second static assertion in above code.
>
I made more room in r237648:
http://llvm.org/viewvc/llvm-project?view=revision&revision=237648
>
> Could you please explain why sizeof VarDeclBitfields and
> ParmVarDeclBitfields must be less than sizeof(unsigned) and also what are
> repercussions if I remove above assertions ?
>
> Thanks
> -Thejaka
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150604/44406365/attachment.html>
More information about the cfe-dev
mailing list