This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67228] New: Template partial ordering failure ambiguous overload
- From: "barry.revzin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 15 Aug 2015 15:35:21 +0000
- Subject: [Bug c++/67228] New: Template partial ordering failure ambiguous overload
- Auto-submitted: auto-generated
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.