This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78753] New: non-ambiguous overload resolution with function template partial ordering rules
- 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: Fri, 09 Dec 2016 14:03:14 +0000
- Subject: [Bug c++/78753] New: non-ambiguous overload resolution with function template partial ordering rules
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78753
Bug ID: 78753
Summary: non-ambiguous overload resolution with function
template partial ordering rules
Product: gcc
Version: 6.2.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 this example:
template <class...> struct pack { };
// (1)
template <class T>
void foo(pack<T> ) { }
// (2)
template <class T, class... Ts>
void foo(pack<T, Ts...> ) { }
int main() {
foo(pack<int>{});
}
gcc (every version I've tried) accepts the code and invokes (1). But
[temp.deduct.type]/9 states arguments that come from pack expansions should be
ignored if P does not contain a template argument corresponding to it - which
is the case here. So partial ordering deduction should succeed in both cases,
making this ambiguous.
Unfortunately.