This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11976] New: parse error accessing member function template out of class template
- From: "jbeulich at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2003 07:57:13 -0000
- Subject: [Bug c++/11976] New: parse error accessing member function template out of class template
- 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=11976
Summary: parse error accessing member function template out of
class template
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jbeulich at novell 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
The following code causes parse errors at the calls to c1::test<T>(). If c2 is
not a class template, these errors are not present. Changing the calls to have
the . followed by template (which is optional) makes the problem go away, too.
class c1 {
public:
template<typename T> T test();
};
template<typename T> class c2 {
public:
void test(c1&rc1) {
rc1.test<int>();
}
void test();
};
template<typename T> void c2<T>::test() {
c1 ic1;
ic1.test<int>();
}