[LLVMbugs] [Bug 18072] Template ambiguous operator overload - with tescase

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 26 16:28:18 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=18072

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
This is deliberate; it's a C++11 rule that GCC doesn't implement yet.

Note that your two 'operator<<' overloads really should be ambiguous: they're
both exact matches, they're both function templates, and neither of them is
more specialized than the other. C++98's rules didn't handle this case very
well (and arbitrarily picked the member function, because they failed to take
into account the ordering of the *this parameter); C++11's rules do the right
thing here, and Clang implements them in C++11 mode.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131127/91bbaffc/attachment.html>


More information about the llvm-bugs mailing list