public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10337: "ambiguous overload"-error for non-ambiguous situation
@ 2003-04-07 12:06 stip
  0 siblings, 0 replies; 4+ messages in thread
From: stip @ 2003-04-07 12:06 UTC (permalink / raw)
  To: gcc-gnats


>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:


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c++/10337: "ambiguous overload"-error for non-ambiguous situation
@ 2003-04-24 16:31 nathan
  0 siblings, 0 replies; 4+ messages in thread
From: nathan @ 2003-04-24 16:31 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nathan, stip

Synopsis: "ambiguous overload"-error for non-ambiguous situation

State-Changed-From-To: analyzed->closed
State-Changed-By: nathan
State-Changed-When: Thu Apr 24 16:31:37 2003
State-Changed-Why:
    fixed in 3.4. Not a regression or error, so not fixing 3.3

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10337


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c++/10337: "ambiguous overload"-error for non-ambiguous situation
@ 2003-04-20 12:52 nathan
  0 siblings, 0 replies; 4+ messages in thread
From: nathan @ 2003-04-20 12:52 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nathan, nobody, stip

Synopsis: "ambiguous overload"-error for non-ambiguous situation

Responsible-Changed-From-To: unassigned->nathan
Responsible-Changed-By: nathan
Responsible-Changed-When: Sun Apr 20 12:52:24 2003
Responsible-Changed-Why:
    fixing

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10337


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c++/10337: "ambiguous overload"-error for non-ambiguous situation
@ 2003-04-10 14:32 bangerth
  0 siblings, 0 replies; 4+ messages in thread
From: bangerth @ 2003-04-10 14:32 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, stip

Synopsis: "ambiguous overload"-error for non-ambiguous situation

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Apr 10 14:32:29 2003
State-Changed-Why:
    I tend to agree

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10337


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-04-24 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07 12:06 c++/10337: "ambiguous overload"-error for non-ambiguous situation stip
2003-04-10 14:32 bangerth
2003-04-20 12:52 nathan
2003-04-24 16:31 nathan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).