http://llvm.org/bugs/show_bug.cgi?id=20498

            Bug ID: 20498
           Summary: Hidden function overloading
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Functions in a derived class which would otherwise be found by overload
resolution should be warned on at the call site. Eg)

(from test/SemaCXX/warn-overload-virtual.cpp)

namespace {
struct base {
  void f(char) {}
};

struct derived : base {
  void f(int) {}
};

void foo(derived &d) {
  d.f('1'); // FIXME: this should warn about calling (anonymous
namespace)::derived::f(int)
            // instead of (anonymous namespace)::base::f(char).
            // Note: this should be under a new diagnostic flag and eventually
moved to a
            // new test case since it's not strictly related to virtual
functions.
  d.f(12);  // This should not warn.
}
}

Since d.f('1') would call base::f(char) were it not hidden by derived::f(int),
that call should result in a warning and ideally a fix-it.

Note that this is not the property of the declaration so much as a property of
the call site.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to