public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/55409] New: std::list not properly wrapping access to custom allocator through allocator_traits
@ 2012-11-20  8:51 benjamin.kircher at gmail dot com
  2012-11-20  9:13 ` [Bug libstdc++/55409] " redi at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: benjamin.kircher at gmail dot com @ 2012-11-20  8:51 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55409
           Summary: std::list not properly wrapping access to custom
                    allocator through allocator_traits
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: benjamin.kircher@gmail.com


Created attachment 28741
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28741
Small example showing simple custom allocator with std::list and std::vector

The attached source file compiles fine with a std::vector as container_type.
Using std::list however, compilation fails with the error message given below.
Expected behavior is that it compiles with std::list as like with std::vector.

$ gcc --version
gcc (Debian 4.7.2-4) 4.7.2


$ cat main.cpp
template<typename T> class my_alloc
{
    // class template supporting the minimal interface according to 17.6.3.5
};

int main()
{
    //typedef std::vector<int, my_alloc<int>> container_type;
    typedef std::list<int, my_alloc<int>> container_type;
    container_type cont;
    cont.push_back(11);
    cont.push_back(22);
    cont.push_back(33);
    return 0;
}


$ g++ -g -std=c++11 -Wall -Wextra -pedantic main.cpp
<snip>
/usr/include/c++/4.7/bits/stl_list.h: In instantiation of ‘class std::list<int,
my_alloc<int> >’:
main.cpp:56:20:   required from here
/usr/include/c++/4.7/bits/stl_list.h:449:58: error: no type named ‘pointer’ in
‘std::list<int, my_alloc<int> >::_Tp_alloc_type {aka class my_alloc<int>}’
/usr/include/c++/4.7/bits/stl_list.h:450:58: error: no type named
‘const_pointer’ in ‘std::list<int, my_alloc<int> >::_Tp_alloc_type {aka class
my_alloc<int>}’
/usr/include/c++/4.7/bits/stl_list.h:451:58: error: no type named ‘reference’
in ‘std::list<int, my_alloc<int> >::_Tp_alloc_type {aka class my_alloc<int>}’
/usr/include/c++/4.7/bits/stl_list.h:452:58: error: no type named
‘const_reference’ in ‘std::list<int, my_alloc<int> >::_Tp_alloc_type {aka class
my_alloc<int>}’
<snip>
and so on.


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

end of thread, other threads:[~2015-09-10 20:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-20  8:51 [Bug libstdc++/55409] New: std::list not properly wrapping access to custom allocator through allocator_traits benjamin.kircher at gmail dot com
2012-11-20  9:13 ` [Bug libstdc++/55409] " redi at gcc dot gnu.org
2012-11-20  9:25 ` redi at gcc dot gnu.org
2012-11-20  9:31 ` benjamin.kircher at gmail dot com
2012-11-20 10:30 ` redi at gcc dot gnu.org
2014-09-02 19:11 ` freddie_chopin at op dot pl
2014-09-03  4:27 ` redi at gcc dot gnu.org
2014-09-03  6:35 ` freddie_chopin at op dot pl
2014-09-03 11:20 ` redi at gcc dot gnu.org
2015-04-10 14:42 ` redi at gcc dot gnu.org
2015-04-10 14:42 ` redi at gcc dot gnu.org
2015-06-16 16:29 ` redi at gcc dot gnu.org
2015-06-17 20:37 ` redi at gcc dot gnu.org
2015-06-17 21:20 ` potswa at mac dot com
2015-06-17 22:20 ` potswa at mac dot com
2015-09-10 20:30 ` redi at gcc dot gnu.org

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