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

* [Bug libstdc++/52799] deque::emplace(iterator, ...) tries to call push_front(...), which doesn't exist
  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 ` paolo.carlini at oracle dot com
  2012-03-31  1:57 ` paolo at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-03-31  1:27 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-03-31
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com
   Target Milestone|---                         |4.7.1
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-31 00:57:22 UTC ---
Oh my, let's fix this for 4.7.1 too.


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

* [Bug libstdc++/52799] deque::emplace(iterator, ...) tries to call push_front(...), which doesn't exist
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-03-31  1:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-03-31 01:57:20 UTC ---
Author: paolo
Date: Sat Mar 31 01:57:14 2012
New Revision: 186036

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186036
Log:
2012-03-30  Jeffrey Yasskin  <jyasskin@gcc.gnu.org>
        Paolo Carlini  <paolo.carlini@oracle.com>

    PR libstdc++/52799
    * include/bits/deque.tcc (emplace): Fix thinko, replace push_front
    -> emplace_front, and likewise for *_back.
    * testsuite/23_containers/deque/modifiers/emplace/52799.cc: New.
    * testsuite/23_containers/list/modifiers/emplace/52799.cc: Likewise.
    * testsuite/23_containers/vector/modifiers/emplace/52799.cc: Likewise.

Added:
   
branches/gcc-4_7-branch/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/
   
branches/gcc-4_7-branch/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/52799.cc
   
branches/gcc-4_7-branch/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/
   
branches/gcc-4_7-branch/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/52799.cc
   
branches/gcc-4_7-branch/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/
   
branches/gcc-4_7-branch/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc
Modified:
    branches/gcc-4_7-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_7-branch/libstdc++-v3/include/bits/deque.tcc


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

* [Bug libstdc++/52799] deque::emplace(iterator, ...) tries to call push_front(...), which doesn't exist
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-03-31  1:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-03-31 01:57:00 UTC ---
Author: paolo
Date: Sat Mar 31 01:56:55 2012
New Revision: 186035

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186035
Log:
2012-03-30  Jeffrey Yasskin  <jyasskin@gcc.gnu.org>
        Paolo Carlini  <paolo.carlini@oracle.com>

    PR libstdc++/52799
    * include/bits/deque.tcc (emplace): Fix thinko, replace push_front
    -> emplace_front, and likewise for *_back.
    * testsuite/23_containers/deque/modifiers/emplace/52799.cc: New.
    * testsuite/23_containers/list/modifiers/emplace/52799.cc: Likewise.
    * testsuite/23_containers/vector/modifiers/emplace/52799.cc: Likewise.

Added:
    trunk/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/
    trunk/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/52799.cc
    trunk/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/
    trunk/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/52799.cc
    trunk/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/
   
trunk/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/deque.tcc


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

* [Bug libstdc++/52799] deque::emplace(iterator, ...) tries to call push_front(...), which doesn't exist
  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
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-03-31  2:03 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-31 01:59:27 UTC ---
Done.


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

* [Bug libstdc++/52799] deque::emplace(iterator, ...) tries to call push_front(...), which doesn't exist
  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
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-09  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:3ec1d76a359542ed4c8370390efa9ee9e25e757f

commit r14-1645-g3ec1d76a359542ed4c8370390efa9ee9e25e757f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jun 8 12:19:26 2023 +0100

    libstdc++: Improve tests for emplace member of sequence containers

    Our existing tests for std::deque::emplace, std::list::emplace and
    std::vector::emplace are poor. We only have compile tests for PR 52799
    and the equivalent for a const_iterator as the insertion point. This
    fails to check that the value is actually inserted correctly and the
    right iterator is returned.

    Add new tests that cover the existing 52799.cc and const_iterator.cc
    compile-only tests, as well as verifying the effects are correct.

    libstdc++-v3/ChangeLog:

            * testsuite/23_containers/deque/modifiers/emplace/52799.cc:
            Removed.
            *
testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc:
            Removed.
            * testsuite/23_containers/list/modifiers/emplace/52799.cc:
            Removed.
            * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc:
            Removed.
            * testsuite/23_containers/vector/modifiers/emplace/52799.cc:
            Removed.
            *
testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc:
            Removed.
            * testsuite/23_containers/deque/modifiers/emplace/1.cc: New
            test.
            * testsuite/23_containers/list/modifiers/emplace/1.cc: New
            test.
            * testsuite/23_containers/vector/modifiers/emplace/1.cc: New
            test.

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

* [Bug libstdc++/52799] deque::emplace(iterator, ...) tries to call push_front(...), which doesn't exist
  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
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-29 23:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:52997b14311726447850341ecaf286b68587ff32

commit r13-7505-g52997b14311726447850341ecaf286b68587ff32
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jun 8 12:19:26 2023 +0100

    libstdc++: Improve tests for emplace member of sequence containers

    Our existing tests for std::deque::emplace, std::list::emplace and
    std::vector::emplace are poor. We only have compile tests for PR 52799
    and the equivalent for a const_iterator as the insertion point. This
    fails to check that the value is actually inserted correctly and the
    right iterator is returned.

    Add new tests that cover the existing 52799.cc and const_iterator.cc
    compile-only tests, as well as verifying the effects are correct.

    libstdc++-v3/ChangeLog:

            * testsuite/23_containers/deque/modifiers/emplace/52799.cc:
            Removed.
            *
testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc:
            Removed.
            * testsuite/23_containers/list/modifiers/emplace/52799.cc:
            Removed.
            * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc:
            Removed.
            * testsuite/23_containers/vector/modifiers/emplace/52799.cc:
            Removed.
            *
testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc:
            Removed.
            * testsuite/23_containers/deque/modifiers/emplace/1.cc: New
            test.
            * testsuite/23_containers/list/modifiers/emplace/1.cc: New
            test.
            * testsuite/23_containers/vector/modifiers/emplace/1.cc: New
            test.

    (cherry picked from commit 3ec1d76a359542ed4c8370390efa9ee9e25e757f)

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

* [Bug libstdc++/52799] deque::emplace(iterator, ...) tries to call push_front(...), which doesn't exist
  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
                   ` (5 preceding siblings ...)
  2023-06-29 23:00 ` cvs-commit at gcc dot gnu.org
@ 2024-03-18 14:05 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-18 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:1bb2bfb5d984456f59b42228f06d4ad4976358e7

commit r12-10240-g1bb2bfb5d984456f59b42228f06d4ad4976358e7
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jun 8 12:19:26 2023 +0100

    libstdc++: Improve tests for emplace member of sequence containers

    Our existing tests for std::deque::emplace, std::list::emplace and
    std::vector::emplace are poor. We only have compile tests for PR 52799
    and the equivalent for a const_iterator as the insertion point. This
    fails to check that the value is actually inserted correctly and the
    right iterator is returned.

    Add new tests that cover the existing 52799.cc and const_iterator.cc
    compile-only tests, as well as verifying the effects are correct.

    libstdc++-v3/ChangeLog:

            * testsuite/23_containers/deque/modifiers/emplace/52799.cc:
            Removed.
            *
testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc:
            Removed.
            * testsuite/23_containers/list/modifiers/emplace/52799.cc:
            Removed.
            * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc:
            Removed.
            * testsuite/23_containers/vector/modifiers/emplace/52799.cc:
            Removed.
            *
testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc:
            Removed.
            * testsuite/23_containers/deque/modifiers/emplace/1.cc: New
            test.
            * testsuite/23_containers/list/modifiers/emplace/1.cc: New
            test.
            * testsuite/23_containers/vector/modifiers/emplace/1.cc: New
            test.

    (cherry picked from commit 3ec1d76a359542ed4c8370390efa9ee9e25e757f)

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