Bug 59974 - gcc v3 failure to compile overloaded code
Summary: gcc v3 failure to compile overloaded code
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc3   
(Show other bugs)
Version: 7.3
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2002-02-17 06:21 UTC by greg hosler
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-02-17 06:25:10 UTC
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 06:25 UTC, greg hosler
no flags Details

Description greg hosler 2002-02-17 06:21:27 UTC
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 06:25:05 UTC
Created attachment 45860 [details]
sample program that fails to compile

Comment 2 Jakub Jelinek 2002-02-18 12:02:34 UTC
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.