public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "Raimund dot Merkert at baesystems dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/32883]  New: Regression: reverse_iterator produces valgrind errors
Date: Tue, 24 Jul 2007 16:30:00 -0000	[thread overview]
Message-ID: <bug-32883-5307@http.gcc.gnu.org/bugzilla/> (raw)

When this code is run with : valgrind --tool=memcheck a.out 5 it produces quite
a few errors. I confirmed this with 4.2.0. The problem is not present in 3.2.2.
Valgrind version is 3.2.3:

#include <set>

using namespace std;

int main()
{
  set<int> c;
  c.insert(1);
  c.insert(2);
  c.insert(3);
  c.insert(4);

  set<int>::reverse_iterator i = c.rbegin();
  c.erase((++i).base());
  *i;
  return 0;
}

A collegue of mine who actually encountered this problem had posted about it
here: 
http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/402c7fb95f649314/a58fd22549a56fca


-- 
           Summary: Regression: reverse_iterator produces valgrind errors
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Raimund dot Merkert at baesystems dot com
  GCC host triplet: g++ (GCC) 3.4.3 20050227 (Red Hat 3.4.3-22.1)


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


             reply	other threads:[~2007-07-24 16:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-24 16:30 Raimund dot Merkert at baesystems dot com [this message]
2007-07-24 16:40 ` [Bug c++/32883] " Raimund dot Merkert at baesystems dot com
2007-07-24 16:54 ` pcarlini at suse dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-32883-5307@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).