[LLVMbugs] [Bug 20175] Perfect forwarding hides proper overload

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 8 10:57:38 PDT 2014


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> ---
The candidates for this call:

  d.out(s, l);


1) int derived::out(int s, const char &w)
2) auto decorator<Aut>::out(Args&&... args) -> decltype(a_.out(args...))
     [Aut = base<std::pair<char, char>>,
      Args = {int&, char&}]

Both overload candidates are viable. The second is preferred, because it is a
better match for the second parameter (a char lvalue prefers a 'char&'
parameter over a 'const char&' parameter) and is no worse on the first
parameter (an int lvalue is equally happy with an 'int' parameter or an 'int&'

So #2 is called.

If you think something else should have happened here, please reopen this bug
and explain what you think should have happened and why.

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/20140708/79ad75ef/attachment.html>

More information about the llvm-bugs mailing list