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

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #3 from Harald van Dijk <harald at gigawatt dot nl> ---
Here's a reduced standalone testcase, no libstdc++.

struct Empty { bool operator==(Empty); };
class tuple_impl : Empty {};
class tuple : tuple_impl, Empty {};
bool operator==(tuple, tuple);
int main() { tuple a, b; a == b; }

tuple derives from Empty twice and would inherit its operator==(Empty) member
function, except any attempt to use it would be ambiguous. GCC and Intel reject
this, clang and MSVC accept it using the global operator==(tuple, tuple). If
tuple only inherits from Empty once, then all compilers are in agreement that
operator==(tuple, tuple) is a better match than the operator==(Empty) member
function.

Reply via email to