From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 863 invoked by alias); 2 Mar 2013 18:55:57 -0000 Received: (qmail 846 invoked by uid 48); 2 Mar 2013 18:55:43 -0000 From: "mmehlich at semanticdesigns dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56506] variadic class template specialization not selected as best match Date: Sat, 02 Mar 2013 18:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mmehlich at semanticdesigns dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-03/txt/msg00134.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56506 --- Comment #1 from Michael Mehlich 2013-03-02 18:55:43 UTC --- Some more information using a function template instead of a class template: -- Additional code template void foo(Y,T>...) { } int main() { Y,int> yi; Y,bool> yb; Y,char> yc; foo(yi,yb,yc); } -- Error message from gcc 4.7.2: test.cpp: In function 'int main()': test.cpp:31:14: error: no matching function for call to 'foo(Y, int>&, Y, bool>&, Y, char>&)' test.cpp:31:14: note: candidate is: test.cpp:15:31: note: template void foo(Y, T>...) test.cpp:15:31: note: template argument deduction/substitution failed: test.cpp:31:14: note: deduced conflicting types for parameter 'T' ('int, bool, char' and 'int') test.cpp:31:14: note: 'Y, int>' is not derived from 'Y, T>' It looks like the compiler decides to bind T to int when handling the first argument instead of binding a "prefix" of T to int.