public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21279] static Derived-to-Base cast fails when ~Derived has run.
       [not found] <bug-21279-8548@http.gcc.gnu.org/bugzilla/>
@ 2006-03-03 20:22 ` jason at gcc dot gnu dot org
  0 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-03-03 20:22 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/21279] static Derived-to-Base cast fails when ~Derived has run.
  2005-04-29  8:18 [Bug c++/21279] New: " murrayc at murrayc dot com
                   ` (2 preceding siblings ...)
  2005-04-30  5:47 ` pinskia at gcc dot gnu dot org
@ 2005-05-02 18:42 ` bangerth at dealii dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2005-05-02 18:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2005-05-02 18:42 -------
I would be very much surprised if this was allowed. But then I, too, can't 
find any normative statements in the standard. Maybe looking at the wrong 
places, though... 
 
W. 

-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/21279] static Derived-to-Base cast fails when ~Derived has run.
  2005-04-29  8:18 [Bug c++/21279] New: " murrayc at murrayc dot com
  2005-04-29  8:20 ` [Bug c++/21279] " murrayc at murrayc dot com
  2005-04-30  5:33 ` hpreg at vmware dot com
@ 2005-04-30  5:47 ` pinskia at gcc dot gnu dot org
  2005-05-02 18:42 ` bangerth at dealii dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-30  5:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-30 05:46 -------
I think this is invalid but I don't have the standard in front of me.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|static Derived-to-Base cast |static Derived-to-Base cast
                   |fails when ~Derived has run.|fails when ~Derived has run.


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/21279] static Derived-to-Base cast fails when ~Derived has run.
  2005-04-29  8:18 [Bug c++/21279] New: " murrayc at murrayc dot com
  2005-04-29  8:20 ` [Bug c++/21279] " murrayc at murrayc dot com
@ 2005-04-30  5:33 ` hpreg at vmware dot com
  2005-04-30  5:47 ` pinskia at gcc dot gnu dot org
  2005-05-02 18:42 ` bangerth at dealii dot org
  3 siblings, 0 replies; 5+ messages in thread
From: hpreg at vmware dot com @ 2005-04-30  5:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hpreg at vmware dot com  2005-04-30 05:33 -------
*** Bug 20304 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hpreg at vmware dot com


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/21279] static Derived-to-Base cast fails when ~Derived has run.
  2005-04-29  8:18 [Bug c++/21279] New: " murrayc at murrayc dot com
@ 2005-04-29  8:20 ` murrayc at murrayc dot com
  2005-04-30  5:33 ` hpreg at vmware dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: murrayc at murrayc dot com @ 2005-04-29  8:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From murrayc at murrayc dot com  2005-04-29 08:20 -------
Created an attachment (id=8761)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8761&action=view)
test_castdeleted.cc

This fails (gives odd values) with g++ 3.3, 3.4 and 4.0.

-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-03-03 20:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21279-8548@http.gcc.gnu.org/bugzilla/>
2006-03-03 20:22 ` [Bug c++/21279] static Derived-to-Base cast fails when ~Derived has run jason at gcc dot gnu dot org
2005-04-29  8:18 [Bug c++/21279] New: " murrayc at murrayc dot com
2005-04-29  8:20 ` [Bug c++/21279] " murrayc at murrayc dot com
2005-04-30  5:33 ` hpreg at vmware dot com
2005-04-30  5:47 ` pinskia at gcc dot gnu dot org
2005-05-02 18:42 ` bangerth at dealii dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).