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

David Majnemer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 22 20:55:44 PDT 2017

majnemer added a comment.

In https://reviews.llvm.org/D37042#849726, @majnemer wrote:

> I'd expect this to be more limited.
> Something like, "if we have a BinaryOperator of + between a CStyleCastExpr of NullToPointer and 'X', emit inttoptr(X)"

Although maybe that is too strict... I guess stuff gets hairy quickly if you want to be able to also catch (char*)NULL + x....


More information about the cfe-commits mailing list