One for the language lawyers

Phil Edwards phil@jaj.com
Fri Feb 22 02:30:00 GMT 2002


On Wed, Feb 20, 2002 at 04:27:11PM -0700, Martin Staley wrote:
> The g++ bugs people told me this morning:
> 
> > Not a bug [in g++].
> >
> >     Function declarations that differ only in the return type cannot
> >     be overloaded.
> >
> > Thus sayeth the standard, [13.1]/2.
> 
> And they later wrote:
> 
> > User error.  Functions differing only in their return types
> > may not be overloaded.

No "they," just me.  (Unless I'm a plurality now... does that mean I get
to use the royal "we"?  Cool.)


>  * The "signature" of a function template includes its return type.
>    [14.5.5.1]/4 states, "The signature of a function template consists of its
>    function signature, its return type and its template parameter list."  In
>    particular, the first sentence of the following paragraph, [14.5.5.1]/5, is
>    directly relevant to my example.

Good point, and one I had not considered when I closed the PR.  Without
looking further, I don't know what's supposed to happen.  I won't have
time to look further this week; someone else can pitch in here?

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams



More information about the Gcc-bugs mailing list