https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442
--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Smith from comment #14) > If I understand correctly, you're looking for documentation that > > __builtin_operator_new(size) > > has the exact same semantics and permits the same optimizations as `::new T` > for a trivially-constructible non-array type `T` whose size is `size` and > that > > __builtin_operator_delete(p) > > has the exact same semantics and permits the same optimizations as `::delete > p` for a trivially-destructible non-array type `T` whose size is `size`, > with `p` of type `T*` -- and similarly for the other (aligned, nothrow) > variants? > > That is the intent; I can look into getting Clang's documentation updated to > say that more explicitly if that's useful to you. I was specifically looking at C++20 7.6.2.7/10 to /14 (but maybe also others and of course the relevant parts of the delete expression). In particular the extra leeway the standard provides to new/delete _expressions_ vs. calls of the global replaceable operators directly - do the __builtin_operator_{new,delete} in this regard behave like new/delete _expressions_ or like direct calls to the operators? Do the builtins call one of the replaceable global new/delete operators and thus users can reliably override them? How do the builtins behave during constexpr evaluation? new/delete expressions have their behavior documented in the standard.