| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
// Origin: Martin von Loewis <[email protected]> |
| 4 |
|
| 5 |
// PR c++/157: Incorrect type/template decision in function parameter. |
| 6 |
|
| 7 |
template <class _Tp> class auto_ptr {}; |
| 8 |
template <class _Tp> |
| 9 |
class counted_ptr { // { dg-message "defined here" } |
| 10 |
public: |
| 11 |
counted_ptr(::auto_ptr<_Tp>& __a); // { dg-message "candidate" } |
| 12 |
::auto_ptr<_Tp> auto_ptr(); |
| 13 |
}; |
| 14 |
|
| 15 |
template <class _Tp> |
| 16 |
inline counted_ptr<_Tp>::counted_ptr(class auto_ptr& __a) |
| 17 |
// { dg-error "no declaration matches" "" { target *-*-* } .-1 } |
| 18 |
// { dg-error "template argument required" "" { target *-*-* } .-2 } |
| 19 |
{ |
| 20 |
} |
| 21 |
|
| 22 |
template <class _Tp> |
| 23 |
inline class auto_ptr<_Tp> counted_ptr<_Tp>::auto_ptr() |
| 24 |
{ |
| 25 |
} |