Description of problem: GCC 4.1.1-30 (FC6) fails to compile the following testcase: ============== mapref.cxx ============== template<typename T> class mapref { public: ~mapref<T>() {}; }; ======================================== In the real life, this behaviour prevents compilation of koffice, more specifically in the kross component (testcase extracted from Objects.hxx): Making all in . make[1]: Entering directory `/opt/build/kde/3.5.5/konstruct/apps/office/koffice/work/koffice-1.6.0/lib/kross/python/cxx' if /bin/sh ../../../../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../lib/kross -I../../../../lib/kross -I/usr/include/python2.4 -I/opt/kde3.5.5/include -I. -DQT_THREAD_SUPPORT -I/opt/kde3.5.5/include -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -I/opt/kde3.5.5/include -L/opt/kde3.5.5/lib64 -L/usr/lib64 -m64 -fPIC -march=opteron -O2 -pipe -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DHAVE_KNEWSTUFF -fexceptions -MT libkrosspythoncxx_la.all_cxx.lo -MD -MP -MF ".deps/libkrosspythoncxx_la.all_cxx.Tpo" -c -o libkrosspythoncxx_la.all_cxx.lo libkrosspythoncxx_la.all_cxx.cxx; \ then mv -f ".deps/libkrosspythoncxx_la.all_cxx.Tpo" ".deps/libkrosspythoncxx_la.all_cxx.Plo"; else rm -f ".deps/libkrosspythoncxx_la.all_cxx.Tpo"; exit 1; fi Objects.hxx:1941: error: parse error in template argument list make[1]: *** [libkrosspythoncxx_la.all_cxx.lo] Error 1 make[1]: Leaving directory `/opt/build/kde/3.5.5/konstruct/apps/office/koffice/work/koffice-1.6.0/lib/kross/python/cxx' make: *** [all-recursive] Error 1 Version-Release number of selected component (if applicable): gcc version 4.1.1 20061011 (Red Hat 4.1.1-30) How reproducible: Always Steps to Reproduce: 1. create file mapref.cxx as above 2. g++ -c mapref.cxx Actual results: # g++ -c mapref.cxx mapref.cxx:3: error: parse error in template argument list Expected results: Compilation succeeds Additional info: This is a regression from FC5. gcc version 4.1.1 20060525 (Red Hat 4.1.1-1) compiles successfully the testcase.
The same problem prevents compilation of the root package from CERN (http://root.cern.ch) which fails with: include/TProofDraw.h:226: error: parse error in template argument list make: *** [proof/src/TProofDraw.o] Error 1 The file include/TProofDraw.h has the following lines (223-232): public: TProofVectorContainer<T>(std::vector<T>* anVector) : fVector(anVector) { }; TProofVectorContainer<T>() : fVector(0) { }; ~TProofVectorContainer<T>() { delete fVector; } std::vector<T> *GetVector() const { return fVector; } Long64_t Merge(TCollection* list); ClassDef(TProofVectorContainer,1) //Class describing a vector container };
This is GCC PR c++/29408, already fixed in gcc-4.1.1-31
Yes, I can confirm, it works with both the old 4.1.1-1.fc5 and the new 4.1.1-32 versions. I hope this fix will find its way into the updates tree quickly.
It will be fixed in the next FC6 gcc updates, ETA around 3 weeks from now.