The following code produce a compilation error at the unique line of the function named "visit" below (it is a basic implementation of a visitor pattern) : # 1 "test.cpp" # 1 "" # 1 "" # 1 "test.cpp" template struct Toto { template void visit(T2 * o) { o->eval(); } }; template struct Titi { template void eval() { } }; int main() { Toto toto; Titi titi; toto.visit(& titi); return 0; } g++ test.cpp -o test test.cpp: In member function «void Toto::visit(T2*)»: test.cpp:7: erreur: expected primary-expression before «>» token test.cpp:7: erreur: expected primary-expression before «)» token make: *** [test] Erreur 1 I tried this with g++-3.4.6 too (it compiles and run well with msvc 8.0). Here is the output of the command "g++ -v -save-temps test.cpp" : Utilisation des specs internes. Cible : i486-linux-gnu Configuré avec: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --with-tune=pentium4 --enable-checking=release i486-linux-gnu Modèle de thread: posix version gcc 4.0.3 (Ubuntu 4.0.3-1ubuntu5) /usr/lib/gcc/i486-linux-gnu/4.0.3/cc1plus -E -quiet -v -D_GNU_SOURCE test.cpp -mtune=pentium4 -fpch-preprocess -o test.ii le répertoire « /usr/local/include/i486-linux-gnu » est ignoré car inexistant le répertoire « /usr/include/i486-linux-gnu » est ignoré car inexistant la recherche pour #include "..." débute ici : la recherche pour #include <...> débute ici: /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c++/4.0.3 /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c++/4.0.3/i486-linux-gnu /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c++/4.0.3/backward /usr/local/include /usr/lib/gcc/i486-linux-gnu/4.0.3/include /usr/include Fin de la liste de recherche. /usr/lib/gcc/i486-linux-gnu/4.0.3/cc1plus -fpreprocessed test.ii -quiet -dumpbase test.cpp -mtune=pentium4 -auxbase test -version -o test.s GNU C++ version 4.0.3 (Ubuntu 4.0.3-1ubuntu5) (i486-linux-gnu) compiled by GNU C version 4.0.3 (Ubuntu 4.0.3-1ubuntu5). heuristiques GGC: --param ggc-min-expand=64 --param ggc-min-heapsize=64420 test.cpp: In member function «void Toto::visit(T2*)»: test.cpp:7: erreur: expected primary-expression before «>» token test.cpp:7: erreur: expected primary-expression before «)» token -- Summary: Template parameter refused as a template parameter. Product: gcc Version: 4.0.3 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: samuel dot hangouet at free dot fr GCC host triplet: Ubuntu 4.0.3-1ubuntu5 GCC target triplet: i486-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29942