This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67228] New: Template partial ordering failure ambiguous overload


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67228

            Bug ID: 67228
           Summary: Template partial ordering failure ambiguous overload
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

In the following code:

#include <tuple>

template<int I>
struct A {};

template<int I, typename... T>
void f(A<I>, std::tuple<T *...>) {} // (1)

template<typename... T>
void f(A<0>, std::tuple<T *...>) {} // (2)

int main()
{
    f(A<0>{}, std::tuple<char*, int*, float*>{});
}

(2) is more specialized and should be preferred, gcc 5.1 reports as ambiguous.
If the two tuples were instead tuple<T...> instead of tuple<T*...>, (2) is
correctly selected. clang accepts the code as is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]