<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 --- - Confusing error message static + virtual method"
   href="https://llvm.org/bugs/show_bug.cgi?id=31790">31790</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Confusing error message static + virtual method
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>jvapen@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17909" name="attach_17909" title="Reproduction">attachment 17909</a> <a href="attachment.cgi?id=17909&action=edit" title="Reproduction">[details]</a></span>
Reproduction

On porting an MSVC codebase to clang-cl, I noticed a very strange error
message.

I have a base class with a virtual method and a derived class with a static
method which happens to have the same name and a different return type. MSVC
somehow considers this valid code (not sure who is right, assuming clang from
its track record). Clang on the other end gives a compilation error that the
virtual method in the derived class has a different return type.

As this method is 'static', I don't expect an error about the return type,
though, about having a static method which happens to be virtual (side effect
of unfortunate name clash) as this is the problem that has to be fixed.

The error that currently is given might also be useful in fixing the issue if
this method should indeed be an override.

(Currently using clang 4.0-rc1)</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>