From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30539 invoked by alias); 12 Aug 2002 14:01:41 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 30528 invoked from network); 12 Aug 2002 14:01:39 -0000 Received: from unknown (HELO www.fastmail.fm) (209.61.183.86) by sources.redhat.com with SMTP; 12 Aug 2002 14:01:39 -0000 Received: from www.fastmail.fm (localhost [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id 72D586DB60; Mon, 12 Aug 2002 09:01:35 -0500 (CDT) X-Epoch: 1029160895 X-Sasl-enc: CTvUiN0skMZJqRs6xeR+xw Received: from fastmail.fm (x1-6-00-e0-81-03-b8-78.k35.webspeed.dk [62.242.176.174]) by www.fastmail.fm (Postfix) with ESMTP id 044406DB91; Mon, 12 Aug 2002 09:01:34 -0500 (CDT) Message-ID: <3D57BFBF.E3872801@fastmail.fm> Date: Mon, 12 Aug 2002 07:01:00 -0000 From: bjorn rohde jensen Reply-To: bjensen@fastmail.fm X-Accept-Language: en MIME-Version: 1.0 To: Andrey Pozdeev Cc: gcc-help@gcc.gnu.org Subject: Re: Problem with overloaded function selection References: <3D578A07.AA20189@mb1.rambler.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00088.txt.bz2 Hi Andrey, The conversions > operator double() {return 0L;}; > operator int() { return 0; }; are equally poor, as one level of user defined conversions and one level of default conversions are required to match > void test(char){}; Having both conversions causes neither to be considered, which means that > operator A() { return A();}; is the only choice. Removing either of > operator double() {return 0L;}; > operator int() { return 0; }; makes the call > test(b); ambiguous, since > void test(char){}; is a candidate through one level of user defined conversions and one level of default conversions and > void test(A){}; is a candidate through one level of user defined conversions. I guess, one will have to look in the specs to see, who is right in this matter. My gut feeling is, that it gcc is right. Conversions and function overloading seem pretty othogonal to me. Why should two conversions be worse than one conversion in matching an overloaded function?? Yours sincerely, Bjorn