public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19544] New: Difference in behaviour if default constructor added
@ 2005-01-20 12:51 chris at bubblescope dot net
  2005-01-20 14:56 ` [Bug libstdc++/19544] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: chris at bubblescope dot net @ 2005-01-20 12:51 UTC (permalink / raw)
  To: gcc-bugs

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.

-- 
           Summary: Difference in behaviour if default constructor added
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chris at bubblescope dot net
                CC: caj at cs dot york dot ac dot uk,gcc-bugs at gcc dot gnu
                    dot org


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


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

end of thread, other threads:[~2005-01-21  2:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-20 12:51 [Bug c++/19544] New: Difference in behaviour if default constructor added chris at bubblescope dot net
2005-01-20 14:56 ` [Bug libstdc++/19544] " pinskia at gcc dot gnu dot org
2005-01-20 15:14 ` chris at bubblescope dot net
2005-01-20 15:21 ` pinskia at gcc dot gnu dot org
2005-01-20 19:19 ` gdr at integrable-solutions dot net
2005-01-20 19:25 ` chris at bubblescope dot net
2005-01-20 19:42 ` gdr at integrable-solutions dot net
2005-01-20 20:46 ` bangerth at dealii dot org
2005-01-20 21:04 ` caj at cs dot york dot ac dot uk
2005-01-21  2:25 ` gdr at integrable-solutions dot net
2005-01-21  2:28 ` gdr at integrable-solutions dot net

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