c++/6506: New STLport regression (const qualifiers)

gbeauchesne@mandrakesoft.com gbeauchesne@mandrakesoft.com
Mon Apr 29 06:56:00 GMT 2002


>Number:         6506
>Category:       c++
>Synopsis:       New STLport regression (const qualifiers)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 29 06:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Gwenole Beauchesne
>Release:        GNU C++ version 3.1 20020429 (prerelease)
>Organization:
>Environment:
i586-mandrake-linux-gnu
>Description:
Recent changes now break STLport-4.5.3

[gbeauchesne@thalys eh]$ g++-3.1 -c test_list2.cpp -save-temps
test_list2.cpp: In copy constructor `test_insert_range<TestList,
   std::_List_iterator<TestClass, TestClass&, TestClass*>
   >::test_insert_range(const test_insert_range<TestList,
   std::_List_iterator<TestClass, TestClass&, TestClass*> >&)':
test_list2.cpp:18:   instantiated from `test_insert_range<C, Iter> insert_range_tester(const C&, const Iter&, const Iter&) [with C = TestList, Iter = std::_List_iterator<TestClass, TestClass&, TestClass*>]'
test_list2.cpp:30:   instantiated from here
test_list2.cpp:18: `const' qualifiers cannot be applied to `const TestList&'
>How-To-Repeat:
The following is extracted from STLport-4.5.3/test/eh/test_list.cpp:

#include <list>

template <class C, class Iter>
class test_insert_range
{
    Iter fFirst, fLast;
    const C & original;
public:
    test_insert_range( const C& orig, Iter first, Iter last )
                : original( orig ), fFirst( first ), fLast( last )
                { }
};

template <class C, class Iter>
test_insert_range<C, Iter>
insert_range_tester( const C& orig, const Iter& first, const Iter& last )
{
    return test_insert_range<C, Iter>( orig, first, last );
}

struct TestClass
{
};

typedef std::list<TestClass> TestList;

void test_list()
{
    TestList testList, testList2;
        insert_range_tester(testList, testList2.begin(), testList2.end());
}
>Fix:
Interestingly, removing bits related to the iterators in class test_insert_range makes it compile again. But that's not a solution.

This is a regression from
GNU C++ version 3.1 20020422 (prerelease)
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list