public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16334] New: No warning about use of overloading extension
@ 2004-07-02 19:10 mmitchel at gcc dot gnu dot org
  2004-07-07 21:02 ` [Bug c++/16334] " jason at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-07-02 19:10 UTC (permalink / raw)
  To: gcc-bugs

G++ has an extension to the overloading rules of C++.  In particular, when ISO
C++ would consider a call ambiguous, G++ does an additional check.  It finds the
function whose *worst* conversion is least bad; if there is a unique such
function, that one is used.  (The code that does this is at the end of "joust".)

Jason indicated that this extension should not be removed due to backwards
compatibility issues, but that we should always be issuing a pedwarn in such cases.

However, if the winning candidate under the extension turns out to be a built-in
operator, no warning is issued.

Jason agreed to make sure that a warning is issued even in that case.  Perhaps
this message will also induce him into documenting this alleged feature in the
extensions portion of the manual. :-)

A test case follows.

extern "C" int printf(const char *, ...);
class MSBinaryVector {
public:
    MSBinaryVector (unsigned int, unsigned char =0)
    {
    }
};
MSBinaryVector operator& (const unsigned char, const MSBinaryVector
                          &){
    printf("not built-in\n");
    return 0;
}
typedef unsigned char __iostate;
enum io_state { eofbit };
int main() {
    __iostate state;
    return state & eofbit;
}

-- 
           Summary: No warning about use of overloading extension
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: jason at redhat dot com
        ReportedBy: mmitchel at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16334


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

* [Bug c++/16334] No warning about use of overloading extension
  2004-07-02 19:10 [Bug c++/16334] New: No warning about use of overloading extension mmitchel at gcc dot gnu dot org
@ 2004-07-07 21:02 ` jason at redhat dot com
  2004-07-07 21:17 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jason at redhat dot com @ 2004-07-07 21:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jason at redhat dot com  2004-07-07 21:02 -------
Subject: Re:  New: No warning about use of overloading
 extension

On 2 Jul 2004 19:10:39 -0000, "mmitchel at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> wrote:

> Jason indicated that this extension should not be removed due to backwards
> compatibility issues

That's not exactly what I meant; I meant that an error that says "this is
ambiguous even though you might expect us to choose this candidate for this
reason" is better than an error that just says "ambiguous".

Patch forthcoming.

Jason


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16334


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

* [Bug c++/16334] No warning about use of overloading extension
  2004-07-02 19:10 [Bug c++/16334] New: No warning about use of overloading extension mmitchel at gcc dot gnu dot org
  2004-07-07 21:02 ` [Bug c++/16334] " jason at redhat dot com
@ 2004-07-07 21:17 ` cvs-commit at gcc dot gnu dot org
  2004-07-07 22:06 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-07 21:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-07-07 21:17 -------
Subject: Bug 16334

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jason@gcc.gnu.org	2004-07-07 21:16:58

Modified files:
	gcc/cp         : ChangeLog call.c 

Log message:
	PR c++/16334
	* call.c (build_new_op): Give overload warnings for built-in
	candidates.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4173&r2=1.4174
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.491&r2=1.492



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16334


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

* [Bug c++/16334] No warning about use of overloading extension
  2004-07-02 19:10 [Bug c++/16334] New: No warning about use of overloading extension mmitchel at gcc dot gnu dot org
  2004-07-07 21:02 ` [Bug c++/16334] " jason at redhat dot com
  2004-07-07 21:17 ` cvs-commit at gcc dot gnu dot org
@ 2004-07-07 22:06 ` pinskia at gcc dot gnu dot org
  2004-07-07 22:23 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-07 22:06 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-07 22:06:09
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16334


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

* [Bug c++/16334] No warning about use of overloading extension
  2004-07-02 19:10 [Bug c++/16334] New: No warning about use of overloading extension mmitchel at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-07-07 22:06 ` pinskia at gcc dot gnu dot org
@ 2004-07-07 22:23 ` pinskia at gcc dot gnu dot org
  2004-07-08 20:52 ` jason at gcc dot gnu dot org
  2004-07-10  0:26 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-07 22:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-07 22:23 -------
Jason can you add the testcase to the testsuite and close this bug or is this needed open for another 
problem?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16334


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

* [Bug c++/16334] No warning about use of overloading extension
  2004-07-02 19:10 [Bug c++/16334] New: No warning about use of overloading extension mmitchel at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-07-07 22:23 ` pinskia at gcc dot gnu dot org
@ 2004-07-08 20:52 ` jason at gcc dot gnu dot org
  2004-07-10  0:26 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu dot org @ 2004-07-08 20:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jason at gcc dot gnu dot org  2004-07-08 20:52 -------
feexed

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16334


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

* [Bug c++/16334] No warning about use of overloading extension
  2004-07-02 19:10 [Bug c++/16334] New: No warning about use of overloading extension mmitchel at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-07-08 20:52 ` jason at gcc dot gnu dot org
@ 2004-07-10  0:26 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-10  0:26 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16334


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

end of thread, other threads:[~2004-07-10  0:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-02 19:10 [Bug c++/16334] New: No warning about use of overloading extension mmitchel at gcc dot gnu dot org
2004-07-07 21:02 ` [Bug c++/16334] " jason at redhat dot com
2004-07-07 21:17 ` cvs-commit at gcc dot gnu dot org
2004-07-07 22:06 ` pinskia at gcc dot gnu dot org
2004-07-07 22:23 ` pinskia at gcc dot gnu dot org
2004-07-08 20:52 ` jason at gcc dot gnu dot org
2004-07-10  0:26 ` pinskia at gcc dot gnu dot org

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).