This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Error compiling templates


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]