This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18497] New: error in parsing function template
- From: "zhaojiangbin at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Nov 2004 07:21:29 -0000
- Subject: [Bug c++/18497] New: error in parsing function template
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The code in question:
==== begin ====
struct C
{
template <typename T> void f() {}
};
template <typename T> void ff()
{
C c;
c.f();
}
==== end ====
g++ 3.3 (version 3.3.5, Debian 1:3.3.5-2) cannot compile the above code. With
command line "g++-3.3 -c -o a.o a.cc", it displays the following error messages:
a.cc: In function `void ff()':
a.cc:9: error: parse error before `>' token
The above code compiles fine in g++ 3.4 (version 3.4.2, Debian 3.4.2-3).
What interesting is if the member function and the free function above have same
name, g++ 3.3 compiles the code without problem. And the code generated seems to
be fine.
--
Summary: error in parsing function template
Product: gcc
Version: 3.3.5
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: zhaojiangbin at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18497