[PATCH] D50050: [AST] CastExpr: BasePathSize is not large enough.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 31 14:02:55 PDT 2018


rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: include/clang/AST/Expr.h:2791
+public:
+  using BasePathSizeTy = unsigned short;
+  static_assert(std::numeric_limits<BasePathSizeTy>::max() >= 16384,
----------------
lebedev.ri wrote:
> erichkeane wrote:
> > I'll let @rjmccall comment here, but I think I'd be willing to give up 2 more bytes here and just go with unsigned int.  It has the advantage of likely never being an issue again (since 4 billion bases is not an issue).
> > 
> > We might be paying for those 2 ANYWAY with alignment as well, right?
> Yes, i do expect that we are paying for 2 bytes in padding already.
Yeah, we could really use a `size_t` here without loss, but an `unsigned` is fine.


Repository:
  rC Clang

https://reviews.llvm.org/D50050





More information about the cfe-commits mailing list