-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Closed
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++abilibc++abi C++ Runtime Library. Not libc++.libc++abi C++ Runtime Library. Not libc++.quality-of-implementation
Description
Current implementation of operator new in libcxx / libcxxabi effectively makes plain new and nothrow new to coincide when exceptions are disabled: both will return nullptr. However, there is one important difference: for nothrow new the constructor is not called when the return value is null. This does not happen for ordinary new in -fno-exceptions case making impossible to check the return value as constructor might just segfault. From the user perspective it might be better to stick to one of the following:
- Just call
abort(). This seems what is currently done for things likestd::__throw_out_of_rangein-fno-exceptcase - Make
operator newand nothrowoperator newto behave identically and do not call constructor
Any thoughts on what might be the better solution?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++abilibc++abi C++ Runtime Library. Not libc++.libc++abi C++ Runtime Library. Not libc++.quality-of-implementation