This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11562] New: Reject legal code : call of template function in a template class
- From: "have at ann dot jussieu dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2003 15:04:01 -0000
- Subject: [Bug c++/11562] New: Reject legal code : call of template function in a template class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11562
Summary: Reject legal code : call of template function in a
template class
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: have at ann dot jussieu dot fr
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: gcc version 3.3.1 20030626
GCC host triplet: Linux-2.4.20 i686
Compiling this piece of code generates a parse error:
test.cpp: In member function `void B<T>::f()':
test.cpp:9: error: syntax error before `;' token
Tested with g++ 2.95.4, 3.0.4, 3.2.3, 3.3.1
Removing 'template<typename T>' does not generate any error.
----%<---------------------------------------
struct A {
template<typename U> void head() { }
};
template<typename T>
struct B {
void f() {
A a;
a.head<int>();
}
};
int main() { }