Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libcxx/include/__new/global_new_delete.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# define _THROW_BAD_ALLOC
#endif

#if defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309L
#if _LIBCPP_STD_VER >= 14
# define _LIBCPP_HAS_SIZED_DEALLOCATION 1
#else
# define _LIBCPP_HAS_SIZED_DEALLOCATION 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// Ensure that libc++ still provides the declaration of sized operator delete even
// when sized deallocation support is disabled at the language level, since it should
// still be valid to call these operators explicitly (as opposed to via a compiler
// rewrite of a delete expression).

// UNSUPPORTED: c++03, c++11

// ADDITIONAL_COMPILE_FLAGS: -fno-sized-deallocation

// Sized deallocation support was introduced in LLVM 11
// XFAIL: using-built-library-before-llvm-11

#include <new>

int main(int, char**) {
void* p = ::operator new(10);
::operator delete(p, 10);
return 0;
}
Loading