public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/52799] New: deque::emplace(iterator, ...) tries to call push_front(...), which doesn't exist
@ 2012-03-30 23:18 jyasskin at gcc dot gnu.org
  2012-03-31  1:27 ` [Bug libstdc++/52799] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jyasskin at gcc dot gnu.org @ 2012-03-30 23:18 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52799
           Summary: deque::emplace(iterator, ...) tries to call
                    push_front(...), which doesn't exist
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jyasskin@gcc.gnu.org


$ cat emplace.cc
#include <deque>

int main() {
  std::deque<int> d;
  d.emplace(d.begin());
}
$ g++-4.8pre --version
g++-4.8pre (GCC) 4.8.0 20120330 (experimental)
$ g++-4.8pre -std=c++11 emplace.cc -c -o /dev/null
In file included from .../include/c++/4.8.0/deque:67:0,
                 from emplace.cc:1:
.../include/c++/4.8.0/bits/deque.tcc: In instantiation of ‘std::deque<_Tp,
_Alloc>::iterator std::deque<_Tp, _Alloc>::emplace(std::deque<_Tp,
_Alloc>::iterator, _Args&& ...) [with _Args = {}; _Tp = int; _Alloc =
std::allocator<int>; std::deque<_Tp, _Alloc>::iterator =
std::_Deque_iterator<int, int&, int*>]’:
emplace.cc:5:22:   required from here
.../include/c++/4.8.0/bits/deque.tcc:178:6: error: no matching function for
call to ‘std::deque<int>::push_front()’
.../include/c++/4.8.0/bits/deque.tcc:178:6: note: candidates are:
In file included from .../include/c++/4.8.0/deque:65:0,
                 from emplace.cc:1:
.../include/c++/4.8.0/bits/stl_deque.h:1357:7: note: void std::deque<_Tp,
_Alloc>::push_front(const value_type&) [with _Tp = int; _Alloc =
std::allocator<int>; std::deque<_Tp, _Alloc>::value_type = int]
.../include/c++/4.8.0/bits/stl_deque.h:1357:7: note:   candidate expects 1
argument, 0 provided
.../include/c++/4.8.0/bits/stl_deque.h:1370:7: note: void std::deque<_Tp,
_Alloc>::push_front(std::deque<_Tp, _Alloc>::value_type&&) [with _Tp = int;
_Alloc = std::allocator<int>; std::deque<_Tp, _Alloc>::value_type = int]
.../include/c++/4.8.0/bits/stl_deque.h:1370:7: note:   candidate expects 1
argument, 0 provided
...


The problem is that deque::emplace(iterator __position, _Args&&... __args)
tries to forward to push_front(std::forward<_Args>(__args)...) instead of
emplace_front(std::forward<_Args>(__args)...), and similarly for *_back().

I haven't checked the other containers for similar problems.


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

end of thread, other threads:[~2024-03-18 14:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-30 23:18 [Bug libstdc++/52799] New: deque::emplace(iterator, ...) tries to call push_front(...), which doesn't exist jyasskin at gcc dot gnu.org
2012-03-31  1:27 ` [Bug libstdc++/52799] " paolo.carlini at oracle dot com
2012-03-31  1:57 ` paolo at gcc dot gnu.org
2012-03-31  1:59 ` paolo at gcc dot gnu.org
2012-03-31  2:03 ` paolo.carlini at oracle dot com
2023-06-09  8:55 ` cvs-commit at gcc dot gnu.org
2023-06-29 23:00 ` cvs-commit at gcc dot gnu.org
2024-03-18 14:05 ` cvs-commit 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).