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

            Bug ID: 42872
           Summary: tag-dispatching with variadic templates results in
                    error "call is ambiguous"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++17
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

Hi,

the following code results in:

<source>:29:5: error: call to 'bar' is ambiguous

    bar(tag_select{}, 1.0, 2.0, 3.0, 4.0);

    ^~~

<source>:7:6: note: candidate function [with Ts = <double, double, double,
double>]

void bar(

     ^

<source>:20:6: note: candidate function [with T1 = tag_select, T2 = double, Ts
= <double, double, double>]

void bar(

     ^

1 error generated.

Compiler returned: 1


Tested with godbolt clang x86-64 trunk (on 8/2/2019) with -std=c++17
*************************************************************************



struct tag_select {};

template<
    typename ...Ts
>
void bar(
    tag_select,
    Ts&& ... ts
)
{
}


template<
    typename T1,
    typename T2,
    typename ...Ts
>
void bar(
    T1&& t1,
    T2&& t2,
    Ts&& ... ts
)
{}

int main()
{
    bar(tag_select{}, 1.0, 2.0, 3.0, 4.0);
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to