1 // RUN: %clang_cc1 -std=c++1z %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
2
3 template<typename T> struct A {
4 A(T = 0);
5 A(void*);
6 };
7
8 template<typename T> A(T*) -> A<long>;
9 A() -> A<int>;
10
11 // CHECK-LABEL: @_Z1fPi(
f(int * p)12 void f(int *p) {
13 // CHECK: @_ZN1AIiEC
14 A a{};
15
16 // CHECK: @_ZN1AIlEC
17 A b = p;
18
19 // CHECK: @_ZN1AIxEC
20 A c = 123LL;
21 }
22
23 namespace N {
24 template<typename T> struct B { B(T); };
25 }
26 using N::B;
27
28 struct X {
29 template<typename T> struct C { C(T); };
30 };
31
32 // CHECK: @_Z1gIiEDaT_DTcv1AfL0p_ES1_IS0_E
g(T x,decltype(A (x)) ,A<T>)33 template<typename T> auto g(T x, decltype(A(x)), A<T>) {}
34 // CHECK: @_Z1hIiEDaT_DTcvN1N1BEfL0p_ENS2_IS0_EE
h(T x,decltype(B (x)) ,B<T>)35 template<typename T> auto h(T x, decltype(B(x)), B<T>) {}
36 // CHECK: @_Z1iI1XiEDaT0_DTcvNT_1CEfL0p_ENS2_1CIS1_EE(
i(T x,decltype(typename U::C (x)) ,typename U::template C<T>)37 template<typename U, typename T> auto i(T x, decltype(typename U::C(x)), typename U::template C<T>) {}
test()38 void test() {
39 g(1, 2, A(3));
40 h(1, 2, B(3));
41 i<X>(1, 2, X::C(3));
42 }
43