public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112810] New: 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
@ 2023-12-01 11:58 waffl3x at protonmail dot com
  2023-12-01 22:18 ` [Bug c++/112810] " pinskia at gcc dot gnu.org
  2023-12-01 22:19 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: waffl3x at protonmail dot com @ 2023-12-01 11:58 UTC (permalink / raw)
  To: gcc-bugs

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. :^)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/112810] 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
  2023-12-01 11:58 [Bug c++/112810] New: 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 waffl3x at protonmail dot com
@ 2023-12-01 22:18 ` pinskia at gcc dot gnu.org
  2023-12-01 22:19 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-01 22:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 56761
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56761&action=edit
C++14 testcase (removes the auto argument and changes into an explict template)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/112810] 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
  2023-12-01 11:58 [Bug c++/112810] New: 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 waffl3x at protonmail dot com
  2023-12-01 22:18 ` [Bug c++/112810] " pinskia at gcc dot gnu.org
@ 2023-12-01 22:19 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-01 22:19 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-12-01
      Known to fail|                            |4.9.0
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, failed since at least GCC 4.9 when C++14 was added.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-01 22:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-01 11:58 [Bug c++/112810] New: 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 waffl3x at protonmail dot com
2023-12-01 22:18 ` [Bug c++/112810] " pinskia at gcc dot gnu.org
2023-12-01 22:19 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).