This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: various problems with template-name template parameters
- To: gawrilow at math dot TU-Berlin dot DE
- Subject: Re: various problems with template-name template parameters
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Wed, 1 Mar 2000 23:00:15 +0100
- CC: gcc-bugs at gcc dot gnu dot org
- References: <14525.10553.563957.776958@sokol.math.TU-Berlin.DE>
> I've brought several code fragments together, because I thought they
> are hitting various bugs in the same corner of the C++ front-end. If
> I'm in error, please split the test suite accordingly and excuse me
> for causing this extra work.
Thanks for your interesting bug reports. I've decided to split them,
see below.
> The actual value of the template-name argument of a member template
> gets "spilled" when passed to another template instantiation:
I've added this into GNATS.
> Here the wrong specialization is being chosen.
I also added this into GNATS.
> This test case has remained rather long despite of all my trying to
> strip off all unnecessary details.
The mainline compiler (2.96 20000229 (experimental)) compiles this
without problems, so the bug appears to be fixed. I've not created a
PR for it.
> I'm not that sure about the last problem, whether it's caused by a
> compiler bug or just by my imperfect understanding of C++. Although
> I haven't found the passage in the Standard explicitly prohibiting
> the following construction:
Again, the mainline compiler compiles this fine, with the messages
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
a.o: In function `g(void)':
a.o(.text+0xc): undefined reference to `void f<template <class> class C>(int)'
a.o(.text+0x19): undefined reference to `void f<template <class> class B>(int)'
a.o(.text+0x26): undefined reference to `void f<template <class> class B>(int)'
Of course, the missing template definition *do* constitute a bug in
your program, as they are not exported - but this is not the problem
we are discussing here :-)
Regards,
Martin