This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14371] New: Unable to parse a function template that calls a member template
- From: "razeh at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2004 20:26:05 -0000
- Subject: [Bug c++/14371] New: Unable to parse a function template that calls a member template
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
g++ 3.3.2 is unable to parse the following:
class field_info {
};
class record {
public:
template <class C> C get(const field_info &i, const int idx = 0) const {
C temporary = C();
return temporary;
}
};
template <typename _T>
void foo(const record &r, field_info fi)
{
r.get<_T>(fi, 0);
}
int main(int argc, char *argv)
{
record a;
field_info fi;
a.get<int>(fi, 0);
}
It produces:
repro.C: In function `void foo(const record&, field_info)':
repro.C:16: error: parse error before `>' token
razeh@terk:/home/host/razeh/testing$ gcc -v
Reading specs from
/usr/local/packages/gcc-3.3.2/lib/gcc-lib/sparc-sun-solaris2.8/3.3.2/specs
Configured with: ../configure --prefix=/usr/local/packages/gcc-3.3.2
--disable-multilib
Thread model: posix
gcc version 3.3.2
My system:
razeh@terk:/home/host/razeh/testing$ uname -a
SunOS terk 5.9 Generic sun4u sparc SUNW,Sun-Blade-1000
--
Summary: Unable to parse a function template that calls a member
template
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: razeh at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: sparc-sun-solaris2.8
GCC host triplet: sparc-sun-solaris2.8
GCC target triplet: sparc-sun-solaris2.8
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14371