Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / numerics / complex.number / cmplx.over / UDT_is_rejected.verify.cpp
blobbc0e5d8142fa8de33fb6bff3262c8a82ca205bae
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 //===----------------------------------------------------------------------===//
9 // <complex>
11 // Test that UDT's convertible to an integral or floating point type do not
12 // participate in overload resolution.
14 #include <complex>
15 #include <type_traits>
16 #include <cassert>
18 template <class IntT>
19 struct UDT {
20 operator IntT() const { return 1; }
23 UDT<float> ft;
24 UDT<double> dt;
25 UDT<long double> ldt;
26 UDT<int> it;
27 UDT<unsigned long> uit;
29 int main(int, char**)
32 std::real(ft); // expected-error {{no matching function}}
33 std::real(dt); // expected-error {{no matching function}}
34 std::real(ldt); // expected-error {{no matching function}}
35 std::real(it); // expected-error {{no matching function}}
36 std::real(uit); // expected-error {{no matching function}}
39 std::imag(ft); // expected-error {{no matching function}}
40 std::imag(dt); // expected-error {{no matching function}}
41 std::imag(ldt); // expected-error {{no matching function}}
42 std::imag(it); // expected-error {{no matching function}}
43 std::imag(uit); // expected-error {{no matching function}}
46 std::arg(ft); // expected-error {{no matching function}}
47 std::arg(dt); // expected-error {{no matching function}}
48 std::arg(ldt); // expected-error {{no matching function}}
49 std::arg(it); // expected-error {{no matching function}}
50 std::arg(uit); // expected-error {{no matching function}}
53 std::norm(ft); // expected-error {{no matching function}}
54 std::norm(dt); // expected-error {{no matching function}}
55 std::norm(ldt); // expected-error {{no matching function}}
56 std::norm(it); // expected-error {{no matching function}}
57 std::norm(uit); // expected-error {{no matching function}}
60 std::conj(ft); // expected-error {{no matching function}}
61 std::conj(dt); // expected-error {{no matching function}}
62 std::conj(ldt); // expected-error {{no matching function}}
63 std::conj(it); // expected-error {{no matching function}}
64 std::conj(uit); // expected-error {{no matching function}}
67 std::proj(ft); // expected-error {{no matching function}}
68 std::proj(dt); // expected-error {{no matching function}}
69 std::proj(ldt); // expected-error {{no matching function}}
70 std::proj(it); // expected-error {{no matching function}}
71 std::proj(uit); // expected-error {{no matching function}}
74 return 0;