<html>
    <head>
      <base href="https://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 --- - Clang misidentifies the parameter to blame in out-of-line definition mismatch"
   href="https://llvm.org/bugs/show_bug.cgi?id=22972">22972</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang misidentifies the parameter to blame in out-of-line definition mismatch
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>arto@bendiken.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14081" name="attach_14081" title="A minimal program to reproduce the bug.">attachment 14081</a> <a href="attachment.cgi?id=14081&action=edit" title="A minimal program to reproduce the bug.">[details]</a></span>
A minimal program to reproduce the bug.

Overview:
---------

When an out-of-line definition of a method doesn't match the original
declaration with regards to parameter const qualifiers, Clang's explanation of
the situation incorrectly identifies which parameter is to blame, picking the
leftmost parameter that has (legal) extra const qualifiers, instead of picking
the actual parameter at fault.

Steps to Reproduce:
-------------------

Compile the attached file using: clang++ -std=c++11 -Wall main.cc

Actual Results:
---------------

    main.cc:7:9: error: out-of-line definition of 'hash' does not match any
declaration in 'hasher'
    ...
    main.cc:3:19: note: type of 1st parameter of member declaration does not
match definition ('const char *' vs 'const char *const')

Expected Results:
-----------------

    main.cc:7:9: error: out-of-line definition of 'hash' does not match any
declaration in 'hasher'
    ...
    main.cc:3:32: note: type of 2nd parameter of member declaration does not
match definition ('long &' vs 'const long &')

Build Date & Platform:
----------------------

Clang 3.6.0 (tags/RELEASE_360/final) on Ubuntu 14.04.2. (Also reproduced with
Clang 3.5.0 and earlier versions.)</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>