public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103833] New: Overloaded static member function cannot be resolved unlike overloaded global function
@ 2021-12-26 12:45 fchelnokov at gmail dot com
  2021-12-26 12:59 ` [Bug c++/103833] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: fchelnokov at gmail dot com @ 2021-12-26 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103833
           Summary: Overloaded static member function cannot be resolved
                    unlike overloaded global function
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

In the following code:
```
void g(int) {}
void g(double) {}

struct A {
    static void m(int) {}
    static void m(double) {}
};

int main() {
   (&g)(0);    //ok
   (&A::m)(0); //error in GCC and Clang
}
```
the resolution of overloaded global function `g` goes fine, but as to similar
static member function `A::m` the overload resolution fails, which looks wrong. 

MSVC has not problem with either case. Demo:
https://gcc.godbolt.org/z/585e5Gc4b

Related discussion: https://stackoverflow.com/q/68947849/7325599

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

* [Bug c++/103833] Overloaded static member function cannot be resolved unlike overloaded global function
  2021-12-26 12:45 [Bug c++/103833] New: Overloaded static member function cannot be resolved unlike overloaded global function fchelnokov at gmail dot com
@ 2021-12-26 12:59 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-26 12:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-12-26
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
           Keywords|                            |rejects-valid

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

end of thread, other threads:[~2021-12-26 12:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-26 12:45 [Bug c++/103833] New: Overloaded static member function cannot be resolved unlike overloaded global function fchelnokov at gmail dot com
2021-12-26 12:59 ` [Bug c++/103833] " 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).