Bug 213891

Summary: GCC parse error in template argument list (testcase)
Product: [Fedora] Fedora Reporter: Philippe Rigault <prigault>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: aoliva, hcmeyer, nvwarr
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 4.1.1-31 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-11-11 08:55:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Philippe Rigault 2006-11-03 17:00:33 UTC
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.

Comment 1 nvwarr 2006-11-06 06:25:56 UTC
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
};




Comment 2 Alexandre Oliva 2006-11-07 05:05:32 UTC
This is GCC PR c++/29408, already fixed in gcc-4.1.1-31

Comment 3 nvwarr 2006-11-07 06:42:05 UTC
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.

Comment 4 Jakub Jelinek 2006-11-11 08:55:15 UTC
It will be fixed in the next FC6 gcc updates, ETA around 3 weeks from now.