I have reduced the code needed to reproduce this compile error down to a single,
simple file:

Contents of b.cpp:
---BEGIN_CODE---
struct MyStruct
{
 template <typename T>
 void
 noop() {}
};

template <typename T>
void
myFunc()
{
 MyStruct ms;
 ms.noop<int>();
}
---END_CODE---

% g++ -c b.cpp
b.cpp: In function `void myFunc()':
b.cpp:13: error: parse error before `>' token
% uname -a
CYGWIN_NT-5.1 rukus 1.5.11(0.116/4/2) 2004-09-04 23:17 i686 unknown unknown 
Cygwin
% g++ -v
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)

This bug report was submitted via http://gcc.gnu.org/bugzilla/enter_bug.cgi .
That page does not have file-upload capabilities, so I couldn't attach the
preprocessed file as requested by the "Reporting Bugs" instructions (a.k.a. bug
writing guidelines).

The "Reporting Bugs" instructions do not document what I should put in the "Host
triplet:", "Target triplet:", and "Build triplet:" fields of the bug report, so
I have left them blank.

I attempted to reproduce this bug in gcc-3.4.4, but I could not get gcc-3.4.4 to
install by following the installation instructions.

I have verified that the above code compiles without error under MIPSpro and
MSVC++ 7.1 .

-- 
           Summary: template function calling template member function does
                    not compile
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: matt_p_carter at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18554

Reply via email to