From bc9efeab61120db9c282def38dd1a052de69f610 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 26 Jan 2017 14:30:45 +0000 Subject: PR libstdc++/79190 add fallback aligned_alloc implementation libstdc++-v3: PR libstdc++/79190 * libsupc++/del_opa.cc (operator delete(void*, std::align_val_t)) [!_GLIBCXX_HAVE_ALIGNED_ALLOC && !_GLIBCXX_HAVE_POSIX_MEMALIGN && !_GLIBCXX_HAVE_MEMALIGN && !_GLIBCXX_HAVE__ALIGNED_MALLOC]: Retrieve original pointer value allocated by malloc. * libsupc++/new_opa.cc [!_GLIBCXX_HAVE_ALIGNED_ALLOC && !_GLIBCXX_HAVE_POSIX_MEMALIGN && !_GLIBCXX_HAVE_MEMALIGN && !_GLIBCXX_HAVE__ALIGNED_MALLOC] (aligned_alloc(size_t, size_t)): Define, adjusting pointer value allocated by malloc and storing for retrieval by operator delete. gcc/testsuite: PR libstdc++/79190 * g++.dg/cpp1z/aligned-new3.C: Replace operator new so behaviour matches replaced operator delete. From-SVN: r244933 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/cpp1z/aligned-new3.C | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4054dd0..79c7295 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-01-26 Jonathan Wakely + + PR libstdc++/79190 + * g++.dg/cpp1z/aligned-new3.C: Replace operator new so behaviour + matches replaced operator delete. + 2017-01-26 Jakub Jelinek * gcc.target/i386/avx512f-kaddw-1.c: Renamed to ... diff --git a/gcc/testsuite/g++.dg/cpp1z/aligned-new3.C b/gcc/testsuite/g++.dg/cpp1z/aligned-new3.C index 73e3343..e50e62c 100644 --- a/gcc/testsuite/g++.dg/cpp1z/aligned-new3.C +++ b/gcc/testsuite/g++.dg/cpp1z/aligned-new3.C @@ -7,6 +7,11 @@ struct alignas(64) A { int i; }; +void* operator new (std::size_t n, std::align_val_t) +{ + return operator new (n); +} + bool deleted = false; void operator delete (void *p, std::size_t, std::align_val_t) { -- cgit v1.1