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
9template <typename T> struct A
10{
11  struct B { };
12  operator B* () const;
13  B *Foo ();
14};
15
16template <typename T> typename A<T>::B *A<T>::Foo ()
17{
18  return 0;
19}
20
21template <typename T> A<T>::operator typename A<T>::B* () const
22{
23  return 0;
24}
25
26void Foo (A<int> &p)
27{
28  p.Foo ();
29  static_cast <A<int>::B *> (p);
30}
31