This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21369] New: Template function definition rejected if function return type begins with 'struct'
- From: "pkoning at equallogic dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 May 2005 20:34:21 -0000
- Subject: [Bug c++/21369] New: Template function definition rejected if function return type begins with 'struct'
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This test program:
struct bar;
template <class T> struct bar *foo (T *p)
{
return p->t;
}
produces an error in 4.0.0:
test.cc:3: error: 'bar' is not a template type
Without the keyword "struct" it compiles fine. Earlier versions
(3.3.2, and I'm pretty sure 3.4.1 as well) don't complain.
I've seen this on a native Linux build, and also a crosscompiler targeted at
netbsd-mips and hosted on i386-mips.
--
Summary: Template function definition rejected if function return
type begins with 'struct'
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pkoning at equallogic dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21369