[llvm-bugs] [Bug 31790] New: Confusing error message static + virtual method

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 29 02:19:13 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=31790

            Bug ID: 31790
           Summary: Confusing error message static + virtual method
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jvapen at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17909
  --> https://llvm.org/bugs/attachment.cgi?id=17909&action=edit
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)

-- 
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/20170129/80b51749/attachment.html>


More information about the llvm-bugs mailing list