[libcxx-commits] [libcxx] [libc++] Don't assume alignment of empty ranges (PR #213752)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 10 00:51:41 PDT 2026


philnik777 wrote:

> > Kinda related: Should we assert alignment (possibly only in debug)? This seems like the kind of thing that will bite users in the end.
> 
> We already do (unless you had something else in mind):
> 
> https://github.com/llvm/llvm-project/blob/d1784c08ac847c9ee2a92c2634c24d5696f5d9c1/libcxx/include/__memory/assume_aligned.h#L33-L34

I meant returning false for `__is_valid_range` if the pointers aren't properly aligned.

https://github.com/llvm/llvm-project/pull/213752


More information about the libcxx-commits mailing list