template <class R, class T>
struct A
{
  explicit A (R (T::*xf) ()) : M (xf) {}
  R operator () (T *x) const { return (x->*M) (); }
private:
  R (T::*M) ();
};

template <class R, class T, class C>
struct B
{
  explicit B (R (T::*xf) (C)) : M (xf) {}
  R operator () (T *x, C y) const { return (x->*M) (y); }
private:
  R (T::*M) (C);
};

template <class R, class T>
inline A<R, T>
foo (R (T::*x) ()) { return A<R, T> (x); }

template <class R, class T, class C>
inline B<R, T, C>
foo (R (T::*x) (C)) { return B<R, T, C> (x); }

template< int X = 1 >
struct I
{
  unsigned int i;
  I () : i (0) {}
  void o (unsigned int x) { i = x; }
  unsigned int o () const { return i; }
};

template<typename T>
struct S
{
  unsigned int bar (void)
  {
    I<> j;
    return foo <unsigned int, I<> > (&I<>::o) (&j);
  }
};

ICEs in GCC 3.4.x and HEAD, compiles with GCC 3.2.3.

-- 
           Summary: ICE in resolve_overloaded_unification
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19311

Reply via email to