Re: very small bug in VC 7.1 by Carl
Carl
Sun Dec 14 18:31:05 CST 2003
This is a multi-part message in MIME format.
------=_NextPart_000_005A_01C3C25F.AB8D1F20
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Lucas Galfaso wrote:
> Hi, I found a small bug in the VC7.1 compiler, the code is not valid,
> but the compiler hit ICE. Here is a small example
The code is not valid according to the C++ standard. To quote Comeau:
Comeau C/C++ 4.3.3 (Aug 6 2003 15:13:37) for ONLINE_EVALUATION_BETA1
Copyright 1988-2003 Comeau Computing. All rights reserved.
MODE:strict errors C++
"ComeauTest.c", line 15: error: a pointer to a bound function may only =
be used to
call the function
this->*func =3D &bar<A,func>::anotherVirtualFunc;
^
detected during instantiation of "bar<A, func>::bar() [with =
A=3Dfoo,
func=3D&foo::someVirtualFunc]" at line 27
1 error detected in the compilation of "ComeauTest.c".
-cd
------=_NextPart_000_005A_01C3C25F.AB8D1F20
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Lucas Galfaso wrote:<BR>> Hi, I =
found a small=20
bug in the VC7.1 compiler, the code is not valid,<BR>> but the =
compiler hit=20
ICE. Here is a small example</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The code is not valid according to the =
C++=20
standard. To quote Comeau:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV><PRE><FONT =
face=3D"Lucida Console" size=3D2>Comeau C/C++ 4.3.3 (Aug 6 2003 =
15:13:37) for ONLINE_EVALUATION_BETA1
Copyright 1988-2003 Comeau Computing. All rights reserved.
MODE:strict errors C++
"ComeauTest.c", line 15: error: a pointer to a bound function may only =
be used to
call the function
this->*func =3D &bar<A,func>::anotherVirtualFunc;
^
detected during instantiation of "bar<A, func>::bar() =
[with A=3Dfoo,
func=3D&foo::someVirtualFunc]" at line 27
1 error detected in the compilation of "ComeauTest.c".
</FONT></PRE>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>-cd</FONT></DIV>
<DIV> </DIV></BODY></HTML>
------=_NextPart_000_005A_01C3C25F.AB8D1F20--