public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41449] Partial aggregate initialization not cleaned up on exception
2009-09-23 15:55 [Bug c++/41449] New: Partial aggregate initialization not cleaned up on exception jason at gcc dot gnu dot org
@ 2009-09-23 15:55 ` jason at gcc dot gnu dot org
2009-12-15 4:03 ` jason at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-09-23 15:55 UTC (permalink / raw)
To: gcc-bugs
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-09-23 15:55:40
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41449
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/41449] New: Partial aggregate initialization not cleaned up on exception
@ 2009-09-23 15:55 jason at gcc dot gnu dot org
2009-09-23 15:55 ` [Bug c++/41449] " jason at gcc dot gnu dot org
2009-12-15 4:03 ` jason at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-09-23 15:55 UTC (permalink / raw)
To: gcc-bugs
15.2 says "An object that is partially constructed or partially destroyed will
have destructors executed for all of its fully constructed base classes and
non-variant members, that is, for subobjects for which the principal
constructor (12.6.2) has completed execution and the destructor has not yet
begun execution." We do this for objects that are created via constructor, and
for array initialization, but not for aggregate initialization of a class:
struct A
{
A() {}
A(const A&) { throw 1; }
};
int bs;
struct B
{
B() { ++bs; }
B(const B&) { ++bs; }
~B() { --bs; }
};
struct C
{
B b1;
A a;
B b2;
};
int main()
{
{
B b1, b2;
A a;
try {
C c = { b1, a, b2 };
} catch (...) {}
}
return bs;
}
icc gets this right.
--
Summary: Partial aggregate initialization not cleaned up on
exception
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jason at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41449
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/41449] Partial aggregate initialization not cleaned up on exception
2009-09-23 15:55 [Bug c++/41449] New: Partial aggregate initialization not cleaned up on exception jason at gcc dot gnu dot org
2009-09-23 15:55 ` [Bug c++/41449] " jason at gcc dot gnu dot org
@ 2009-12-15 4:03 ` jason at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-12-15 4:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jason at gcc dot gnu dot org 2009-12-15 04:02 -------
Perhaps this is related to bug 11633.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41449
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-15 4:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-23 15:55 [Bug c++/41449] New: Partial aggregate initialization not cleaned up on exception jason at gcc dot gnu dot org
2009-09-23 15:55 ` [Bug c++/41449] " jason at gcc dot gnu dot org
2009-12-15 4:03 ` jason at gcc dot gnu 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).