[llvm-bugs] [Bug 30594] New: ambiguous overload of function call operator allowed

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 2 16:41:49 PDT 2016


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

            Bug ID: 30594
           Summary: ambiguous overload of function call operator allowed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jeff.mirwaisi at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following should be considered ambiguous:

//no error - incorrect behavior
struct B1{void operator()(){}}; 
struct B2{void operator()(int){}}; 
struct D:B1,B2{};
int main()
{
  D{}();
} 

without an explicit using declaration in D the overloads provided by the two
bases should be considered ambiguous as in the analogous case for member
functions.

//error: member 'f' found in multiple base classes of different types - correct 
//behavior
struct B1{void f(){}}; 
struct B2{void f(int){}}; 
struct D:B1,B2{};

int main()
{
    D{}.f();
}

-- 
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/20161002/1e3144b6/attachment.html>


More information about the llvm-bugs mailing list