[LLVMbugs] [Bug 17218] New: Incorrect -Woverloaded-virtual when parent overload is private.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 12 16:25:10 PDT 2013


            Bug ID: 17218
           Summary: Incorrect -Woverloaded-virtual when parent overload is
           Product: clang
           Version: 3.2
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kalaxy at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Using the following compiler:
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)

To compile the following code:

template <typename Type>
class A {
    virtual void func(Type) {}

class B : A<int>, A<double> {
    virtual void func(int);

Using the following command line:
clang -Wall -c test.cpp

Generates the following warning:
clang_hides_overload.cpp:7:15: warning: 'B::func' hides overloaded virtual
function [-Woverloaded-virtual]
        virtual void func(int);
clang_hides_overload.cpp:3:15: note: hidden overloaded virtual function
'A<double>::func' declared here
        virtual void func(Type) {}
1 warning generated.

I believe this is not true since the base method 'A<double>::func' is private
and thus was never available to B anyway.

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/20130912/ef0bcd82/attachment.html>

More information about the llvm-bugs mailing list