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

Reply via email to