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

            Bug ID: 126677
           Summary: GCC accepts invalid program involving overloaded
                    member function templates
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

The following c++ program is accepted by gcc but rejected by both clang and
msvc. https://godbolt.org/z/eMEocrGce
```
#include <iostream>

struct S {
    template<typename... T>
    int f(T...)&{ return 1; }
    template<typename... T>
    int f(T...){ return 2; }
};


int main()
{
    std::cout << S{}.f(4,5);//GCC OK but Clang NO

}
```

Reply via email to