Currently __builtin_assume_dereferenceable isn't constexpr. I don't think there is a fundamental problem with constant evaluating it though. It should be possible to check whether, from a certain pointer, there are indeed N bytes that can be dereferenced. The compiler has to do that anyways AFAICT, since out of bounds accesses need to be diagnosed during constant evaluation.