<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Improve substitution failure diagnostic"
   href="http://llvm.org/bugs/show_bug.cgi?id=21228">21228</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Improve substitution failure diagnostic
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gonzalobg88@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When the "error: no matching function for call to 'some_function'" appears, a 
list of candidates is displayed along with the reason why they have been
ignored. 
Example:

somefile.hpp:1:1: note: candidate template ignored: substitution failure :
      deduced non-type template argument does not have the same type as the its
corresponding template parameter
      ('long long' vs 'my_int' (aka 'int'))

In these messages it is clear that there was a substitution failure due to a
type mismatch (e.g. long long vs int). However, it is not 100% clear which type
the function was expecting, and which type it was provided. One might _deduce_
that since the deduced paramenter is mentioned first, then it must be 'long
long' in this case, while since the corresponding template parameter is
mentioned second, it must be 'int'.

I would rather free the user from having to deduce anything (that is what the
compiler is there for), and make the note idiot proof: 

somefile.hpp:35:13: note: candidate template ignored: substitution failure :
      deduced non-type template argument ('long long') does not have the same
type as its corresponding template parameter ('my_int' aka 'int').
      [ deduced 'long long' != provided 'my_int' (aka 'int') ]


...or the other way around:

 [ deduced 'my_int' (aka 'int') != 'long long' ]

such that the message is correct.</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>