]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Add align_alloc attribute to aligned operator new
authorJonathan Wakely <jwakely@redhat.com>
Tue, 9 Jan 2024 13:16:11 +0000 (13:16 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 31 Oct 2024 10:24:08 +0000 (10:24 +0000)
commit646b24efaa50b149c12d0ae432999cb5a0cd12f2
treef2ac431e8e2f7be81c0037ec749d6fb94a9626e3
parentb39f62ff739e9ffea0e6485667f15b985f8cd63d
libstdc++: Add align_alloc attribute to aligned operator new

The aligned versions of operator new should use the align_alloc
attribute to help the compiler.

PR c++/86878 requests that the compiler would use the attribute to warn
about invalid attributes, so an XFAILed test is added for that.

libstdc++-v3/ChangeLog:

* libsupc++/new (operator new): Add attribute align_alloc(2) to
overloads taking a std::align_val_t argument.
* testsuite/18_support/new_aligned_warn.cc: New test.

Reviewed-by: Jakub Jelinek <jakub@redhat.com>
libstdc++-v3/libsupc++/new
libstdc++-v3/testsuite/18_support/new_aligned_warn.cc [new file with mode: 0644]