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]
Other format: [Raw text]

[Bug c++/21279] static Derived-to-Base cast fails when ~Derived has run.



------- Comment #5 from jason at gcc dot gnu dot org  2006-03-03 20:21 -------
3.8     Object Lifetime    [basic.life]
...
Before the lifetime of an object has started but after the storage which the
object will occupy has been allocated or, after the lifetime of an object has
ended and before the storage which the object occupied is reused or released,
any pointer that refers to the storage location where the object will be or was
located may be used but only in limited ways.
...
If the object will be or was of a non-POD class type, the program has undefined
behavior if:
...
      -- the pointer is implicitly converted (4.10) to a pointer to a base
class type, or
      -- the pointer is used as the operand of a static_cast (5.2.9) (except
when the conversion is to void*, or to void* and subsequently to char*, or
unsigned char* ).


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21279


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