This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/19544] Difference in behaviour if default constructor added
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jan 2005 19:19:30 -0000
- Subject: [Bug libstdc++/19544] Difference in behaviour if default constructor added
- References: <20050120125055.19544.chris@bubblescope.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2005-01-20 19:19 -------
Subject: Re: New: Difference in behaviour if default constructor added
"chris at bubblescope dot net" <gcc-bugzilla@gcc.gnu.org> writes:
| While looking at PR 19510, I noticed the following strangeness.
|
| Consider:
| --
| #include<vector>
| struct ptr
| {
| int* a;
| ptr() {}
| };
| std::vector<ptr> v(1);
| --
| At -O3 -Wall
| This code produces the error message:
| ...../include/c++/4.0.0/bits/stl_construct.h: In function 'void
| __static_initialization_and_destruction_0(int,int)':
| ...../include/c++/4.0.0/bits/stl_construct.h:81: warning: 'SR.186' is used
| uninitalized in this function
|
| This warning is not generated if I declare ptr without a default constructor,
| although 12.1/7 seems to imply that the default generated constructor should be
| exactly what I have written down.
This is a bug in your code. Can you explain me why it is suddenly a
bug in the library?
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19544