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

--- Comment #6 from asmwarrior <asmwarrior at gmail dot com> ---
Hi, all, I create a simple c++ program to reproduce this bug:

#include <set>
#include <map>
typedef std::set<int>  IntSet;
typedef std::map<int, IntSet> IntToSetMap;

int main()
{
    IntToSetMap m;
    IntSet s;
    s.insert(5);
    m[3] = s;
    IntSet& refSet = m[3];
    refSet.insert(6);
    return 0;
}

Now, you can set a BP in the line "refSet.insert(6);", and run the command "p
refSet", you will get the error message.

Python Exception <type 'exceptions.IndexError'> list index out of range: 
$1 = std::set with 1 elements

If you run "n", and then type "p refSet" again, you get:
Python Exception <type 'exceptions.IndexError'> list index out of range: 
$2 = std::set with 2 elements

It looks like the elements number(from 1 to 2) is correct.
Thanks

Yuanhui Zhang

Reply via email to