<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Unsafe perfect forwarding"
   href="http://llvm.org/bugs/show_bug.cgi?id=20174">bug 20174</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>richard-llvm@metafoo.co.uk
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Unsafe perfect forwarding"
   href="http://llvm.org/bugs/show_bug.cgi?id=20174#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Unsafe perfect forwarding"
   href="http://llvm.org/bugs/show_bug.cgi?id=20174">bug 20174</a>
              from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
        <pre>It looks like Clang is behaving correctly here?

This:

  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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>