https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112810

            Bug ID: 112810
           Summary: bogus ambiguous overload resolution when taking
                    address of static/xobj member function template
                    introduced by using declaration where candidates have
                    a mismatched deduced return type
           Product: gcc
           Version: 4.9.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: waffl3x at protonmail dot com
  Target Milestone: ---

struct B {
  static auto f(auto) { return 10; }
  static int g(auto) { return 10; }
};

struct S0 : B {
  using B::f;
  using B::g;
  static auto f(auto) { return 5; }
  static auto g(auto) { return 5; }
};

struct S1 : B {
  using B::f;
  using B::g;
  static int f(auto) { return 5; }
  static int g(auto) { return 5; }
};

void test()
{
  int (*p0)(int) = &S0::f;
  int (*p1)(int) = &S0::g;
  int (*p2)(int) = &S1::f;
  int (*p3)(int) = &S1::g;
}


https://godbolt.org/z/ebcjshfYd

This does not present in other cases of overload resolution as far as
I've seen. It did not seem to manifest for implicit object member
functions at all.

The godbolt reproducer uses a slightly different test case to test much
older versions of the compiler. I was shocked to find out just how far
back this goes. And I was investigating it to make sure my patch wasn't
causing it!

I can look into fixing it after I finish my patch, if I remember, but
that's why I'm posting this report, just in case I don't remember. :^)

Reply via email to