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: unassignedclangb...@nondot.org
          Reporter: jva...@gmail.com
                CC: dgre...@apple.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to