xref: /llvm-project/clang/test/SemaTemplate/constructor-template.cpp (revision c8c277a1b33cdde021c29b06af53c36a005bfb23)
1 // RUN: clang-cc -fsyntax-only -verify %s
2 
3 struct X0 { // expected-note{{candidate}}
4   X0(int); // expected-note{{candidate}}
5   template<typename T> X0(T);
6   template<typename T, typename U> X0(T*, U*);
7 
8   // PR4761
9   template<typename T> X0() : f0(T::foo) {}
10   int f0;
11 };
12 
13 void accept_X0(X0);
14 
15 void test_X0(int i, float f) {
16   X0 x0a(i);
17   X0 x0b(f);
18   X0 x0c = i;
19   X0 x0d = f;
20   accept_X0(i);
21   accept_X0(&i);
22   accept_X0(f);
23   accept_X0(&f);
24   X0 x0e(&i, &f);
25   X0 x0f(&f, &i);
26 
27   X0 x0g(f, &i); // expected-error{{no matching constructor}}
28 }
29