OSDN Git Service

PR c++/28606
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / parse / conv_op1.C
1
2 // { dg-do compile }
3
4 // Copyright (C) 2002 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 21 Dec 2002 <nathan@codesourcery.com>
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 }