This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/58354] variadic template ambiguous
- From: "officesamurai at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Nov 2014 17:21:28 +0000
- Subject: [Bug c++/58354] variadic template ambiguous
- Auto-submitted: auto-generated
- References: <bug-58354-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58354
Mikhail Kremnyov <officesamurai at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |officesamurai at gmail dot com
--- Comment #1 from Mikhail Kremnyov <officesamurai at gmail dot com> ---
There is a simpler case.
test.cpp:
template <typename T1, typename T2, typename... Types>
void foo(T2, Types...)
{
}
template <typename T1, typename... Types>
void foo(int, Types...)
{
}
int main()
{
foo<void>(1, 2);
}
Command line:
g++ -std=c++11 test.cpp -o test
Output:
test.cpp: In function âint main()â:
test.cpp:13:17: error: call of overloaded âfoo(int, int)â is ambiguous
foo<void>(1, 2);
^
test.cpp:13:17: note: candidates are:
test.cpp:2:6: note: void foo(T2, Types ...) [with T1 = void; T2 = int; Types =
{int}]
void foo(T2, Types...)
^
test.cpp:7:6: note: void foo(int, Types ...) [with T1 = void; Types = {int}]
void foo(int, Types...)
I tried this with versions 4.8.1, 4.9.1, 4.9.2 - same result.
Clang has no problems with this code.