public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13652] New: GCC gives spurious error for template function overloaded on return type.
@ 2004-01-12 6:57 gprentice at paradise dot net dot nz
2004-01-12 7:04 ` [Bug c++/13652] [DR 271] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: gprentice at paradise dot net dot nz @ 2004-01-12 6:57 UTC (permalink / raw)
To: gcc-bugs
GCC fails to compile this valid code. As per 14.5.5.1/4 a template function
can be overloaded on the return type. GCC says #2 ambiguates #1.
VC7.1, Comeau and BCC5.5.1 all accept the code. See also active issue 271.
Thanks to Rani Sharoni for pointing this out.
template<typename T> long* f(T, char); // #1
template<typename T> char* f(T, char); // #2
int main()
{
typedef char* (*fp1)(int, char);
fp1 x1 = f;
x1(3,4);
}
--
Summary: GCC gives spurious error for template function
overloaded on return type.
Product: gcc
Version: 3.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gprentice at paradise dot net dot nz
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13652
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/13652] [DR 271] GCC gives spurious error for template function overloaded on return type.
2004-01-12 6:57 [Bug c++/13652] New: GCC gives spurious error for template function overloaded on return type gprentice at paradise dot net dot nz
@ 2004-01-12 7:04 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-12 7:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-12 07:04 -------
Been fixed since at least 3.3.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Keywords| |rejects-valid
Resolution| |FIXED
Summary|GCC gives spurious error for|[DR 271] GCC gives spurious
|template function overloaded|error for template function
|on return type. |overloaded on return type.
Target Milestone|--- |3.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13652
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-01-12 7:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-12 6:57 [Bug c++/13652] New: GCC gives spurious error for template function overloaded on return type gprentice at paradise dot net dot nz
2004-01-12 7:04 ` [Bug c++/13652] [DR 271] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).