Bug 59974 - gcc v3 failure to compile overloaded code
gcc v3 failure to compile overloaded code
Product: Red Hat Linux
Classification: Retired
Component: gcc3 (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2002-02-17 01:21 EST by greg hosler
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-02-17 01:25:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
sample program that fails to compile (872 bytes, application/octet-stream)
2002-02-17 01:25 EST, greg hosler
no flags Details

  None (edit)
Description greg hosler 2002-02-17 01:21:27 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.79 [en] (X11; U; Linux 2.4.9-13smp-MO i686; Nav)

Description of problem:
See attached example code. gcc v3 fails to compile giving a confused error
about selecting one method over another due to "because worst conversion for the
former is better than worst conversion for the latter"

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. see attached. untar tarball,
2. run doit (./doit)
3. observe error messages

Actual Results:  bogus error messages

Expected Results:  clean compile with no error messages

Additional info:
Comment 1 greg hosler 2002-02-17 01:25:05 EST
Created attachment 45860 [details]
sample program that fails to compile
Comment 2 Jakub Jelinek 2002-02-18 07:02:34 EST
This is covered in ISO C++ 98 [over] chapter.
By default, g++ now defaults to -pedantic-errors, unless -pedantic or
-fpermissive is given.
If you use -pedantic with g++ 2.96-RH or earlier, you'll get an error too.
The problem is that one overloading candidate is const qualified, the other
one has worse type.

As quick workaround, you can use -fpermissive, long term the code needs to be

Note You need to log in before you can comment on or make changes to this bug.