public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3747: ambiguity between `T operator[](unsigned)` and `T* operator`
@ 2002-02-01 4:26 jason
0 siblings, 0 replies; 3+ messages in thread
From: jason @ 2002-02-01 4:26 UTC (permalink / raw)
To: apataki, martin.gerbershagen, gcc-bugs, gcc-prs, jan, nobody
Synopsis: ambiguity between `T operator[](unsigned)` and `T* operator`
State-Changed-From-To: open->closed
State-Changed-By: jason
State-Changed-When: Fri Feb 1 04:26:25 2002
State-Changed-Why:
Not a bug, as explained by Hyman Rosen. However, as a g++ extension this code will compile with -fpermissive.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3747
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/3747 ambiguity between `T operator[](unsigned)` and `T* operator`
@ 2001-10-16 5:56 Billinghurst, David (CRTS)
0 siblings, 0 replies; 3+ messages in thread
From: Billinghurst, David (CRTS) @ 2001-10-16 5:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/3747; it has been noted by GNATS.
From: "Billinghurst, David (CRTS)" <David.Billinghurst@riotinto.com>
To: "'jan@etpmod.phys.tue.nl'" <jan@etpmod.phys.tue.nl>,
"'gcc-gnats@gcc.gnu.org'" <gcc-gnats@gcc.gnu.org>,
"'gcc-prs@gcc.gnu.org'" <gcc-prs@gcc.gnu.org>,
"'martin.gerbershagen@icn.siemens.de'" <apataki@apataki.dhs.org>,
"'gcc-bugs@gcc.gnu.org'" <gcc-bugs@gcc.gnu.org>,
"'nobody@gcc.gnu.org'"
<nobody@gcc.gnu.org>
Cc:
Subject: Re: c++/3747 ambiguity between `T operator[](unsigned)` and `T* o
perator`
Date: Tue, 16 Oct 2001 12:39:24 -0000
PR 3830 and PR 4556 appear to be duplicates, or at least closely related.
These have been closed, and reporters added to the CC list.
^ permalink raw reply [flat|nested] 3+ messages in thread
* c++/3747: ambiguity between `T operator[](unsigned)` and `T* operator`
@ 2001-07-20 8:16 jan
0 siblings, 0 replies; 3+ messages in thread
From: jan @ 2001-07-20 8:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 3747
>Category: c++
>Synopsis: ambiguity between `T operator[](unsigned)` and `T* operator`
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Jul 20 08:16:03 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: jan@etpmod.phys.tue.nl
>Release: gcc version 3.0
>Organization:
>Environment:
Linux 2.4.6,
Configured with: ../../src/egcs-3.0/configure --enable-version-specific-runtime-libs --prefix=/usr/local/egcs-3.0
>Description:
The attached code (file strtest.cpp) fails to compile with egcs version 3.0 (or with the head branch). This is a regression wrt 2.95.x
Gcc-3.0:pcjan:/home/jan/src>g++ -c strtest.cpp
strtest.cpp:6: choosing `char& A::operator[](unsigned int)' over `operator[]'
strtest.cpp:6: because worst conversion for the former is better than worst
conversion for the latter
The compiler is in doubt: it cannot choose between A.operator[](0) and
A.(operator const char*).`c-builtin[]`(0). IMHO the first conversion has preference and should be chosen.
>How-To-Repeat:
Compile the attached file strtest.cpp
>Fix:
This bug breaks existing code, I could not think of a transparent workaround. If `0' is replaced with `0u' (unsigned 0), the snippet compiles properly.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="strtest.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="strtest.cpp"
c3RydWN0IEEgewoJY2hhciBvcGVyYXRvcltdKHVuc2lnbmVkKSBjb25zdDsKCW9wZXJhdG9yIGNv
bnN0IGNoYXIqKCkgY29uc3Q7Cn07CkEgczsKY2hhciBjPXNbMHVdOwo=
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-02-01 12:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-01 4:26 c++/3747: ambiguity between `T operator[](unsigned)` and `T* operator` jason
-- strict thread matches above, loose matches on Subject: below --
2001-10-16 5:56 c++/3747 " Billinghurst, David (CRTS)
2001-07-20 8:16 c++/3747: " jan
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).