public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/103992] New: common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at
@ 2022-01-12 16:25 hewillk at gmail dot com
  2022-01-12 16:50 ` [Bug libstdc++/103992] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hewillk at gmail dot com @ 2022-01-12 16:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103992
           Summary: common_iterator(const common_iterator<_It2, _Sent2>&
                    __x) uses new instead of construct_at
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

common_iterator(const common_iterator<_It2, _Sent2>& __x) and
common_iterator(const common_iterator& __x) still use new.

#include<iterator>

template<class T>
using CI = std::common_iterator<
  std::reverse_iterator<T>, 
  std::unreachable_sentinel_t>;

static_assert([] {
  CI<const int*> it1 = CI<int*>{};
  return true;
}());

https://godbolt.org/z/aT431jrhd

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

* [Bug libstdc++/103992] common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at
  2022-01-12 16:25 [Bug libstdc++/103992] New: common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at hewillk at gmail dot com
@ 2022-01-12 16:50 ` redi at gcc dot gnu.org
  2022-01-12 21:23 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-12 16:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-01-12

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I meant to fix this as part of r12-6438 and forgot.

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

* [Bug libstdc++/103992] common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at
  2022-01-12 16:25 [Bug libstdc++/103992] New: common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at hewillk at gmail dot com
  2022-01-12 16:50 ` [Bug libstdc++/103992] " redi at gcc dot gnu.org
@ 2022-01-12 21:23 ` redi at gcc dot gnu.org
  2022-01-14 10:14 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-12 21:23 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Target Milestone|---                         |12.0

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Patch incoming ...

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

* [Bug libstdc++/103992] common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at
  2022-01-12 16:25 [Bug libstdc++/103992] New: common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at hewillk at gmail dot com
  2022-01-12 16:50 ` [Bug libstdc++/103992] " redi at gcc dot gnu.org
  2022-01-12 21:23 ` redi at gcc dot gnu.org
@ 2022-01-14 10:14 ` cvs-commit at gcc dot gnu.org
  2022-01-14 10:29 ` redi at gcc dot gnu.org
  2022-07-22  7:07 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-14 10:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:d67ba1dce9796bff177e52e2bbb68bfa2c69a884

commit r12-6572-gd67ba1dce9796bff177e52e2bbb68bfa2c69a884
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Jan 12 16:58:18 2022 +0000

    libstdc++: Use std::construct_at in std::common_iterator [PR103992]

    This should have been done as part of the LWG 3574 changes.

    libstdc++-v3/ChangeLog:

            PR libstdc++/103992
            * include/bits/stl_iterator.h (common_iterator): Use
            std::construct_at instead of placement new.
            * testsuite/24_iterators/common_iterator/1.cc: Check copy
            construction is usable in constant expressions.

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

* [Bug libstdc++/103992] common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at
  2022-01-12 16:25 [Bug libstdc++/103992] New: common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at hewillk at gmail dot com
                   ` (2 preceding siblings ...)
  2022-01-14 10:14 ` cvs-commit at gcc dot gnu.org
@ 2022-01-14 10:29 ` redi at gcc dot gnu.org
  2022-07-22  7:07 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-14 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed, thanks for the report

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

* [Bug libstdc++/103992] common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at
  2022-01-12 16:25 [Bug libstdc++/103992] New: common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at hewillk at gmail dot com
                   ` (3 preceding siblings ...)
  2022-01-14 10:29 ` redi at gcc dot gnu.org
@ 2022-07-22  7:07 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-22  7:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:64beecc2201a1da216a8d3feca85974e08e3c890

commit r11-10164-g64beecc2201a1da216a8d3feca85974e08e3c890
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Jan 12 16:58:18 2022 +0000

    libstdc++: Use std::construct_at in std::common_iterator [PR103992]

    This should have been done as part of the LWG 3574 changes.

    libstdc++-v3/ChangeLog:

            PR libstdc++/103992
            * include/bits/stl_iterator.h (common_iterator): Use
            std::construct_at instead of placement new.
            * testsuite/24_iterators/common_iterator/1.cc: Check copy
            construction is usable in constant expressions.

    (cherry picked from commit d67ba1dce9796bff177e52e2bbb68bfa2c69a884)

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

end of thread, other threads:[~2022-07-22  7:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 16:25 [Bug libstdc++/103992] New: common_iterator(const common_iterator<_It2, _Sent2>& __x) uses new instead of construct_at hewillk at gmail dot com
2022-01-12 16:50 ` [Bug libstdc++/103992] " redi at gcc dot gnu.org
2022-01-12 21:23 ` redi at gcc dot gnu.org
2022-01-14 10:14 ` cvs-commit at gcc dot gnu.org
2022-01-14 10:29 ` redi at gcc dot gnu.org
2022-07-22  7:07 ` 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).