[llvm-bugs] [Bug 39487] New: libcpp_deallocate.sh.cpp test failing on older macOS targets
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Oct 29 11:55:04 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=39487
Bug ID: 39487
Summary: libcpp_deallocate.sh.cpp test failing on older macOS
targets
Product: libc++
Version: unspecified
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: ldionne at apple.com
CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
Created attachment 21044
--> https://bugs.llvm.org/attachment.cgi?id=21044&action=edit
Full error message
Since r345281:
Implement sized deallocation for std::allocator and friends.
Summary:
C++14 sized deallocation is disabled by default due to ABI concerns.
However, when a user manually enables it then libc++ should take advantage of
it since sized deallocation can provide a significant performance win depending
on the underlying malloc implementation. (Note that libc++'s definitions of
sized delete don't do anything special yet, but users are free to provide their
own).
This patch updates __libcpp_deallocate to selectively call sized operator
delete when it's available. `__libcpp_deallocate_unsized` should be used when
the size of the allocation is unknown.
On Apple this patch makes no attempt to determine if the sized operator
delete is unavailable, only that the language feature is enabled. This could
cause a compile error when using `std::allocator`, but the same compile error
would occur whenever the user calls `new`, so I don't think it's a problem.
Reviewers: ldionne, mclow.lists
Reviewed By: ldionne
Subscribers: rsmith, ckennelly, libcxx-commits, christof
Differential Revision: https://reviews.llvm.org/D53120
The following is failing:
./build/bin/llvm-lit
libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
--param=std=c++11 --param=platform=macosx10.7 --param=with_availability=true -v
With this error (full error attached):
$ ./build/bin/llvm-lit
libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
--param=std=c++11 --param=platform=macosx10.7 --param=with_availability=true -v
[...]/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp:228:14:
error: 'operator delete' is unavailable: introduced in macOS 10.12
int* x = new int(42);
^
[...]/libcxx/include/new:197:74: note: 'operator delete' has been
explicitly marked unavailable here
_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void
operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
^
[...]/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp:234:22:
error: aligned allocation function of type 'void *(std::size_t,
std::align_val_t)' is only available on macOS 10.13 or newer
[-Waligned-allocation-unavailable]
AlignedType* a = new AlignedType();
^
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181029/9b928387/attachment.html>
More information about the llvm-bugs
mailing list