Bug 59974

Summary: gcc v3 failure to compile overloaded code
Product: [Retired] Red Hat Linux Reporter: greg hosler <greg>
Component: gcc3Assignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-02-17 06:25:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
sample program that fails to compile none

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

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