This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Error compiling templates
- To: poblete at lim dot com
- Subject: Re: Error compiling templates
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Tue, 31 Aug 1999 00:49:15 +0200
- CC: egcs-bugs at egcs dot cygnus dot com, cpoblete at acm dot org
- References: <NCBBKDLMOAADPBBLMGBHEEJHCCAA.poblete@lim.com>
> Our code has been compiling with NO problem in Sun and HP as well as gcc
> 2.7.x and the old egcs. It also compiles in Visual C++!!! Besides the
> author of our code has 5+ years more experience than I am, and cares less if
> we cannot port them to Linux. egcs compiler fix is my only hope.
Please understand that we don't 'fix' the compiler if there is no bug.
That other compilers accept the code is no indication whatsoever, all
those compilers have known bugs in the area of templates themselves,
or provide extensions to C++ without diagnosing their usage (which is
also a bug).
So, you have to provide a little more foundation for claims that the
compiler is broken, as I have explained, I fail to see the bug.
> Further, when Auto class is instantiated before specialization the ff.
> compiles:
> template <class Truck, class Nissan>
> Auto<Truck, Nissan>::foo() {}
> But this one does not:
> Auto<Truck, Nissan>::foo() {}
This is not surprising. In the former, Truck and Nissan are template
parameter names, not the global classes. You are free to use different
template parameter names for each method, and g++ certainly supports
that.
Regards,
Martin