public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42797]  New: call of overloaded 'allocator()' is ambiguous
@ 2010-01-19  6:00 foom at fuhm dot net
  2010-01-19  6:15 ` [Bug c++/42797] " foom at fuhm dot net
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: foom at fuhm dot net @ 2010-01-19  6:00 UTC (permalink / raw)
  To: gcc-bugs

On Linux x86_64
g++ --version:
g++ (Debian 20100117-1) 4.5.0 20100117 (experimental) [trunk revision 155979]

Compiling with:
g++ -O2 -g -std=c++0x -c test.cpp

The following program:

#include <vector>
#include <map>
struct Foo {
    Foo() {}

    template<typename Tp>
    Foo(Tp *p) {}
};

void foo() {
    std::map <int, std::vector<Foo>> the_map;

    the_map[1] = std::vector<Foo>();
}

Produces the below error. However, it *doesn't* produce an error if compiled
without the -g switch (nor with -O1 instead of -O2).


In file included from /usr/include/c++/4.5.0/bits/move.h:38:0,
                 from /usr/include/c++/4.5.0/bits/stl_pair.h:60,
                 from /usr/include/c++/4.5.0/bits/stl_algobase.h:66,
                 from /usr/include/c++/4.5.0/vector:61,
                 from test.cpp:1:
/usr/include/c++/4.5.0/type_traits: In constructor 'std::vector<_Tp,
_Alloc>::vector(std::vector::size_type, const value_type&, const
allocator_type&) [with _Tp = Foo, _Alloc = std::allocator<Foo>,
std::vector::size_type = long unsigned int, value_type = Foo, allocator_type =
std::allocator<Foo>]':
/usr/include/c++/4.5.0/type_traits:224:67:   instantiated from 'const bool
std::__is_constructible_helper<std::vector<Foo>, const int&&>::__value'
/usr/include/c++/4.5.0/type_traits:235:5:   instantiated from
'std::is_constructible<std::vector<Foo>, const int&&>'
/usr/include/c++/4.5.0/bits/stl_map.h:451:11:   instantiated from here
/usr/include/c++/4.5.0/type_traits:224:67: error: call of overloaded
'allocator()' is ambiguous
/usr/include/c++/4.5.0/bits/allocator.h:103:7: note: candidates are:
std::allocator<_Tp>::allocator(const std::allocator<_Tp>&) [with _Tp = Foo,
std::allocator<_Tp> = std::allocator<Foo>]
/usr/include/c++/4.5.0/bits/allocator.h:101:7: note:                
std::allocator<_Tp>::allocator() [with _Tp = Foo]
/usr/include/c++/4.5.0/type_traits:224:67: error: call of overloaded
'allocator()' is ambiguous
/usr/include/c++/4.5.0/bits/allocator.h:103:7: note: candidates are:
std::allocator<_Tp>::allocator(const std::allocator<_Tp>&) [with _Tp = Foo,
std::allocator<_Tp> = std::allocator<Foo>]
/usr/include/c++/4.5.0/bits/allocator.h:101:7: note:                
std::allocator<_Tp>::allocator() [with _Tp = Foo]
/usr/include/c++/4.5.0/type_traits:218:2: error: call of overloaded
'allocator()' is ambiguous
/usr/include/c++/4.5.0/bits/allocator.h:103:7: note: candidates are:
std::allocator<_Tp>::allocator(const std::allocator<_Tp>&) [with _Tp = Foo,
std::allocator<_Tp> = std::allocator<Foo>]
/usr/include/c++/4.5.0/bits/allocator.h:101:7: note:                
std::allocator<_Tp>::allocator() [with _Tp = Foo]


-- 
           Summary: call of overloaded 'allocator()' is ambiguous
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: foom at fuhm dot net


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


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

end of thread, other threads:[~2010-02-07  4:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-19  6:00 [Bug c++/42797] New: call of overloaded 'allocator()' is ambiguous foom at fuhm dot net
2010-01-19  6:15 ` [Bug c++/42797] " foom at fuhm dot net
2010-01-19 10:28 ` rguenth at gcc dot gnu dot org
2010-01-20 10:49 ` [Bug c++/42797] [4.5 Regression] " rguenth at gcc dot gnu dot org
2010-01-22 23:55 ` rguenth at gcc dot gnu dot org
2010-01-29 14:31 ` dodji at gcc dot gnu dot org
2010-01-29 16:09 ` dodji at gcc dot gnu dot org
2010-01-29 16:09 ` dodji at gcc dot gnu dot org
2010-02-07  4:49 ` hjl at gcc dot gnu dot 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).