This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11976] New: parse error accessing member function template out of class template


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>();
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]