| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
// Copyright (C) 2002 Free Software Foundation, Inc. |
| 4 |
// Contributed by Nathan Sidwell 24 Dec 2002 <[email protected]> |
| 5 |
|
| 6 |
// PR 8702. Failure to match templates. |
| 7 |
|
| 8 |
template <typename X> struct C1{}; |
| 9 |
|
| 10 |
template <typename X> |
| 11 |
struct C2 { |
| 12 |
template<typename Y> operator C1<Y>(); |
| 13 |
template<typename Y> operator C2<Y>(); |
| 14 |
}; |
| 15 |
|
| 16 |
template<typename X> template<typename Y> |
| 17 |
C2<X>::operator C1<Y>() |
| 18 |
{ |
| 19 |
return C1<Y>(); |
| 20 |
} |
| 21 |
|
| 22 |
struct A { // { dg-message "defined here" } |
| 23 |
operator int (); // { dg-message "operator" } |
| 24 |
operator float (); // { dg-message "operator" } |
| 25 |
operator float () const; // { dg-message "operator" } |
| 26 |
template <typename T> operator T * (); // { dg-message "operator" } |
| 27 |
}; |
| 28 |
|
| 29 |
A::operator short () { // { dg-error "no declaration matches" } |
| 30 |
return 0; |
| 31 |
} |