[PATCH] D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc

Andy Kaylor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 19 14:19:01 PDT 2017


andrew.w.kaylor added a comment.

This is breaking buildbots for 32-bit targets because the offset in 'nullptr + int8_t_N' is being implicitly cast to an int.  That makes the sizeof(offset) == sizeof(ptr) check turn out differently than my tests were assuming.

I can get the buildbots green quickly by taking out parts of the tests, but I just talked to Erich Keane about this and we think the right way to fix this long term is to stop checking for sizeof(offset) == sizeof(ptr) in the code that identifies the idiom, since that check is of dubious value and would be difficult to always get to behave the way I intended.


Repository:
  rL LLVM

https://reviews.llvm.org/D37042





More information about the cfe-commits mailing list