| 1 |
|
| 2 |
// { dg-do compile } |
| 3 |
|
| 4 |
// Copyright (C) 2002 Free Software Foundation, Inc. |
| 5 |
// Contributed by Nathan Sidwell 21 Dec 2002 <[email protected]> |
| 6 |
|
| 7 |
// PR 8572. ICE with templated conversion operators. |
| 8 |
|
| 9 |
template <typename T> struct A |
| 10 |
{ |
| 11 |
struct B { }; |
| 12 |
operator B* () const; |
| 13 |
B *Foo (); |
| 14 |
}; |
| 15 |
|
| 16 |
template <typename T> typename A<T>::B *A<T>::Foo () |
| 17 |
{ |
| 18 |
return 0; |
| 19 |
} |
| 20 |
|
| 21 |
template <typename T> A<T>::operator typename A<T>::B* () const |
| 22 |
{ |
| 23 |
return 0; |
| 24 |
} |
| 25 |
|
| 26 |
void Foo (A<int> &p) |
| 27 |
{ |
| 28 |
p.Foo (); |
| 29 |
static_cast <A<int>::B *> (p); |
| 30 |
} |