https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94295
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:c9ca352186226ae757688e160e7c6f394c9f26aa commit r12-2470-gc9ca352186226ae757688e160e7c6f394c9f26aa Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu Jul 22 14:38:34 2021 +0100 libstdc++: Use __builtin_operator_new when available [PR94295] Clang provides __builtin_operator_new and __builtin_operator_delete, which have the same semantics as ::operator new and ::operator delete except that the compiler is allowed to elide calls to them. This changes std::allocator to use those built-in functions so that memory allocated by std::allocator can be optimized away when using Clang. This avoids an abstraction penalty for using std::allocator to allocate storage rather than a new-expression. Signed-off-by: Jonathan Wakely <jwak...@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/94295 * include/ext/new_allocator.h (_GLIBCXX_OPERATOR_NEW) (_GLIBCXX_OPERATOR_DELETE, _GLIBCXX_SIZED_DEALLOC): Define. (allocator::allocate, allocator::deallocate): Use new macros.