This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77449] New: False ambiguity for variadic function with non-deduced template parameter
- From: "rbock at eudoxos dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Sep 2016 07:33:30 +0000
- Subject: [Bug c++/77449] New: False ambiguity for variadic function with non-deduced template parameter
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77449
Bug ID: 77449
Summary: False ambiguity for variadic function with non-deduced
template parameter
Product: gcc
Version: 6.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rbock at eudoxos dot de
Target Milestone: ---
g++ considers the following code ambiguous:
template <typename X, typename Check, typename... T>
auto bar(Check, T...) -> void;
template <typename X, typename... T>
auto bar(int, T...) -> void;
int main()
{
bar<void>(7, ""); // ambiguous according to gcc
bar<void>(7); // just fine
}
clang, msvc and icc agree that `auto bar(int, T...) -> void;` is more specific.
They therefore consider the code non-ambiguous.
Hint: The ambiguity is not seen by g++ if
- parameter T is non-variadic or
- parameter X is removed