gcc/testsuite/g++.old-deja/g++.pt/overload15.C
raw| 1 | // { dg-do assemble } |
| 2 | // Test resolution of templatized overloaded constructors. |
| 3 | // The more specialized constructor, i.e., A (const B<Dim1,Dim2> &b) |
| 4 | // should be chosen per \S 14.5.5.2/2 [temp.func.order/2]. |
| 5 | |
| 6 | template <int Dim1, int Dim2> |
| 7 | struct B { |
| 8 | int f; |
| 9 | }; |
| 10 | |
| 11 | struct A { |
| 12 | template <int Dim1, int Dim2> |
| 13 | A (const B<Dim1,Dim2> &b) {} |
| 14 | |
| 15 | template <typename T> |
| 16 | A (const T &b) {} |
| 17 | }; |
| 18 | |
| 19 | int |
| 20 | main () |
| 21 | { |
| 22 | B<2,3> b; |
| 23 | A a (b); |
| 24 | return 0; |
| 25 | } |