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

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Aug 19 11:47:00 GMT 2003


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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           Keywords|                            |rejects-valid
         Resolution|                            |FIXED


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-19 11:47 -------
Already fixed on the mainline and this was a known problem with GCC 2.95.3 to (not 
including) 3.4.
The workaround is to use template:
class c1 {
public:
        template<typename T> T test();
};

template<typename T> class c2 {
public:
        void test(c1&rc1) {
                rc1.template test<int>();
        }
        void test();
};

template<typename T> void c2<T>::test() {
        c1 ic1;
        ic1.template test<int>();
}



More information about the Gcc-bugs mailing list