[Bug c++/66914] incorrect template partial ordering prefers non-member function instead of being ambiguous

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 17 15:30:00 GMT 2015


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
EDG and Clang both reject it as ambiguous.

Looks like a dup of PR 53499

Reduced:

extern "C" int puts(const char*);

template <typename N>
struct A {
    template <typename T>
    void operator+(T const&) { 
        puts("member\n");
    }
};

template <typename N>
void operator+(A<N>&, int const& ) { 
    puts("free\n");
}

int main()
{
    A<int> a;
    a + 2;
}

*** This bug has been marked as a duplicate of bug 53499 ***



More information about the Gcc-bugs mailing list