Bug 213891 - GCC parse error in template argument list (testcase)
GCC parse error in template argument list (testcase)
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2006-11-03 12:00 EST by Philippe Rigault
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version: 4.1.1-31
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-11-11 03:55:15 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Philippe Rigault 2006-11-03 12:00:33 EST
Description of problem:
GCC 4.1.1-30 (FC6) fails to compile the following testcase:

============== mapref.cxx ==============
template<typename T> class mapref {
                ~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 
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; \
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 
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.
Comment 1 nvwarr 2006-11-06 01:25:56 EST
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):
   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

Comment 2 Alexandre Oliva 2006-11-07 00:05:32 EST
This is GCC PR c++/29408, already fixed in gcc-4.1.1-31
Comment 3 nvwarr 2006-11-07 01:42:05 EST
Yes, I can confirm, it works with both the old 4.1.1-1.fc5 and the new 4.1.1-32

I hope this fix will find its way into the updates tree quickly.
Comment 4 Jakub Jelinek 2006-11-11 03:55:15 EST
It will be fixed in the next FC6 gcc updates, ETA around 3 weeks from now.

Note You need to log in before you can comment on or make changes to this bug.