public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104204] New: Ambiguity error for out of class definition of member function template in the presence of a member function of the same name
@ 2022-01-24 14:42 fchelnokov at gmail dot com
  2022-01-24 18:19 ` [Bug c++/104204] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: fchelnokov at gmail dot com @ 2022-01-24 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104204
           Summary: Ambiguity error for out of class definition of member
                    function template in the presence of a member function
                    of the same name
           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: ---

This code is accepted by other compilers:
```
template<typename T>
struct A {
    void f();
    template<typename U>
    void f();
};

template<>
template<typename U>
void A<double>::f() { }
```
but GCC complains:
```
error: ambiguous template specialization 'f<>' for 'void A<double>::f()'
```
Demo: https://gcc.godbolt.org/z/sfP5Kzr7Y

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

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

end of thread, other threads:[~2022-01-24 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24 14:42 [Bug c++/104204] New: Ambiguity error for out of class definition of member function template in the presence of a member function of the same name fchelnokov at gmail dot com
2022-01-24 18:19 ` [Bug c++/104204] " pinskia at gcc dot gnu.org
2022-01-24 18:54 ` fchelnokov at gmail dot com
2022-01-24 19:14 ` 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).