------- Comment #1 from ubizjak at gmail dot com 2010-07-04 21:52 ------- Created an attachment (id=21087) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21087&action=view) testcase
This is a simple testcase for this bug. With G++ 4.5 you will get auch output: TestIndex constructor at 0xB76EA018 P1 0 TestIndex constructor at 0xB76EA018 P2 0 P1 0 TestIndex destructor at 0xB76EA018 TestIndex destructor at 0xB76EA018 A constructor should never be called twice on the same memory address. With G++ 4.4 you will get two different addresses like this: TestIndex constructor at 0xB76EA018 P1 0 TestIndex constructor at 0xB76E6018 P2 0 P1 0 TestIndex destructor at 0xB76E6018 TestIndex destructor at 0xB76EA018 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44815