From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11150 invoked by alias); 20 Feb 2002 16:16:08 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 11081 invoked by uid 71); 20 Feb 2002 16:16:03 -0000 Date: Wed, 20 Feb 2002 08:59:00 -0000 Message-ID: <20020220161603.11080.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Phil Edwards Subject: Re: c++/5732: g++ not using return type for overload resolution Reply-To: Phil Edwards X-SW-Source: 2002-02/txt/msg00502.txt.bz2 List-Id: The following reply was made to PR c++/5732; it has been noted by GNATS. From: Phil Edwards To: mstaley@lanl.gov Cc: gcc-gnats@gcc.gnu.org Subject: Re: c++/5732: g++ not using return type for overload resolution Date: Wed, 20 Feb 2002 11:07:34 -0500 On Tue, Feb 19, 2002 at 08:26:52PM -0700, Martin Staley wrote: > > template > T fun(const T &) > { > std::cout << "foo" << std::endl; > return 0; > } > > template > typename T::value_type fun(const T &) > { > std::cout << "bar" << std::endl; > return 0; > } Not a bug. Function declarations that differ only in the return type cannot be overloaded. Thus sayeth the standard, [13.1]/2.