1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// test new_handler
10
11#include <new>
12#include <type_traits>
13#include <cassert>
14
15#include "test_macros.h"
16
17void f() {}
18
19int main(int, char**)
20{
21 static_assert((std::is_same<std::new_handler, void(*)()>::value), "");
22 std::new_handler p = f;
23 assert(p == &f);
24
25 return 0;
26}
27

source code of libcxx/test/std/language.support/support.dynamic/alloc.errors/new.handler/new_handler.pass.cpp