Hi,
For this
template< typename T >
struct X {
void f(X) {}
};
template< typename T >
struct Y : public X<Y>{
void f(Y) {}
};
int main()
{
Y<int> y;
return 0;
}
code, which VC7.1 accepts, Comeau says
"ComeauTest.c", line 7: error: argument list for class template "Y" is missing
struct Y : public X<Y>{
^
and CW9 doesn't like it either.
I'm pretty sure 'Y' can be used in place of
'Y<T>' only after the opening { -- However,
while I'm sure the standard specifies this
somewhere, everytime I look into this I feel
like I can't read...
So I suspect this is a bug VC7.1.
Schobi
P.S.: Now, let me guess... OK... according to
how this usually goes, Carl will pick it
up, check it against Whidbey (sorry, but
I don't have a spare machine and it blew
my VC7.1 installation when I tried side-
by-side with VC7.1), and say either that
this is fixed in Whidbey, or that he will
report it (TIA!), although there is not
much hope that it will be fixed too soon
because accepting illegal code doesn't
get a very high priority...
Am I right? :)

Signature
SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org
"Sometimes compilers are so much more reasonable than people."
Scott Meyers
Carl Daniel [VC++ MVP] - 06 May 2004 17:32 GMT
> P.S.: Now, let me guess... OK... according to
> how this usually goes, Carl will pick it
[quoted text clipped - 8 lines]
> get a very high priority...
> Am I right? :)
Exactly so. I get the same behavior with Whidbey.
As for whether it's illegal, I too was unable to find anything very explicit
in the standard (including TC1) that clearly says that VC is wrong, but I
think it follows from 14.6.1, 10.2 and 3.3.6 that the injected class name
isn't visible in the base class list, so the name must include the template
arguments at that point.
I'll go ahead and submit a bug report - and yes, it'll get a low priority
assigned to it.
-cd
Hendrik Schober - 07 May 2004 11:47 GMT
> [...]
> > Am I right? :)
>
> Exactly so. [...]
:o>
> I'll go ahead and submit a bug report [...]
Thanks again, Carl!
> -cd
Schobi

Signature
SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org
"Sometimes compilers are so much more reasonable than people."
Scott Meyers