[LLVMbugs] [Bug 20174] Unsafe perfect forwarding

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 8 10:51:58 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 #2 from Richard Smith <richard-llvm at metafoo.co.uk> ---
It looks like Clang is behaving correctly here?


  d.out(12, 'a');

considers the following functions:

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

The first one doesn't work. The second one does work, and calls

  base<std::tuple<char, char>>::out(int, word)

passing in 12 and 'a'. This constructs a  std::tuple<char, char>('a'), that is,
std::tuple<char, char>('a', '\0').

If you disagree, please reopen this bug and explain what you think should
happen here 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/e821bcab/attachment.html>

More information about the llvm-bugs mailing list