From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28242 invoked by alias); 7 Apr 2003 12:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 28188 invoked by uid 71); 7 Apr 2003 12:06:00 -0000 Resent-Date: 7 Apr 2003 12:06:00 -0000 Resent-Message-ID: <20030407120600.28187.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, stip@mathematik.uni-ulm.de Received: (qmail 28137 invoked by uid 48); 7 Apr 2003 12:05:46 -0000 Message-Id: <20030407120546.28136.qmail@sources.redhat.com> Date: Mon, 07 Apr 2003 12:06:00 -0000 From: stip@mathematik.uni-ulm.de Reply-To: stip@mathematik.uni-ulm.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10337: "ambiguous overload"-error for non-ambiguous situation X-SW-Source: 2003-04/txt/msg00254.txt.bz2 List-Id: >Number: 10337 >Category: c++ >Synopsis: "ambiguous overload"-error for non-ambiguous situation >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Mon Apr 07 12:06:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Alexander Stippler >Release: unknown-1.0 >Organization: >Environment: Solaris 2.9 gcc 3.2 >Description: convtest.cc:25: ambiguous overload for `B& = C&' operator convtest.cc:9: candidates are: void B::operator=(const A&) convtest.cc:10: void B::operator=(const B&) The second assignment operator (line 10) has to be chosen IMO because of section 13.3.3.2/3 of the standard. Compiles with gcc 3.3 / 3.4 but emits warnings (why?) class A { public: A() {} }; class B : public A { public: B() {} void operator=(const A& b) {} void operator=(const B& b) {} }; class C { public: C() {} operator B &() { return _b; } operator const B &() const { return _b; } B _b; }; int main() { B b; C c; b = c; } >How-To-Repeat: g++ convtest.cc >Fix: >Release-Note: >Audit-Trail: >Unformatted: