Skip to content

ambiguous overload of function call operator allowed #29942

Closed as not planned
Closed as not planned
@llvmbot

Description

@llvmbot
Bugzilla Link 30594
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"duplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions