This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
eb18
- To: egcs-patches at cygnus dot com
- Subject: eb18
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Mon, 1 Jun 1998 12:32:21 +0200
A static cast is only correct if there is some conversion defined.
Martin
Index: eb18.C
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb18.C,v
retrieving revision 1.1
diff -c -p -r1.1 eb18.C
*** eb18.C 1998/05/27 23:00:35 1.1
--- eb18.C 1998/06/01 10:23:42
*************** class C { };
*** 4,8 ****
void foo()
{
C c;
! void * v = static_cast<void *>(c);
}
--- 4,8 ----
void foo()
{
C c;
! void * v = static_cast<void *>(c); // ERROR - illegal cast
}