From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10826 invoked by alias); 20 Jan 2008 01:50:40 -0000 Received: (qmail 5762 invoked by uid 48); 20 Jan 2008 01:49:55 -0000 Date: Sun, 20 Jan 2008 02:57:00 -0000 Message-ID: <20080120014955.5761.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/34877] Invalid conversion in lookup of variadic template In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" 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: 2008-01/txt/msg02139.txt.bz2 ------- Comment #2 from pinskia at gcc dot gnu dot org 2008-01-20 01:49 ------- This is accepted for the same reason why the code you have is accepted: std::cout << max(3u, -1) << std::endl; If we write the second max as: template T max( T a, T b, Args... args ) { return a > max(b, args...) ? a : max(b, args...); } We get a correct rejection so this is not a bug. t.cc: In function 'T max(T, T, Args ...) [with T = unsigned int, Args = int]': t.cc:17: instantiated from here t.cc:11: error: no matching function for call to 'max(unsigned int&, int&)' t.cc:11: error: no matching function for call to 'max(unsigned int&, int&)' -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34877