The attribute just means that there will be no regular return, it still
leaves room for exceptions to be thrown. It is easily verified: there
are no direct returns and the last statement is either a throw or a call
to abort.
Having the annotation helps static analyzers with this code from
Support/MemAlloc.h (slightly simplified):
LLVM_ATTRIBUTE_RETURNS_NONNULL inline void *safe_malloc(size_t Sz) {
void *Result = std::malloc(Sz); if (Result == nullptr) report_bad_alloc_error("Allocation failed"); return Result;
}
Were report_bad_alloc_error to return regularly, the function would
return nullptr, contradicting the attribute.