gcc/testsuite/g++.old-deja/g++.mike/p3524a.C
raw| 1 | // { dg-do assemble } |
| 2 | // Make sure we can initialize a reference to a templated type, that |
| 3 | // requires a conversion from a derived type to a base type. |
| 4 | |
| 5 | // prms-id: 3524 |
| 6 | |
| 7 | struct cc2Vector |
| 8 | {}; |
| 9 | |
| 10 | template <class T> |
| 11 | struct ccPair |
| 12 | { |
| 13 | ccPair (const cc2Vector&); |
| 14 | }; |
| 15 | |
| 16 | struct ccLine : cc2Vector |
| 17 | { |
| 18 | double distToPoint (const ccPair <float> &); |
| 19 | }; |
| 20 | |
| 21 | void foo () |
| 22 | { |
| 23 | ccLine l2; |
| 24 | l2.distToPoint (l2); |
| 25 | } |