public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier
@ 2021-09-10  8:10 hewillk at gmail dot com
  2021-09-10  8:26 ` [Bug libstdc++/102270] " hewillk at gmail dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: hewillk at gmail dot com @ 2021-09-10  8:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102270
           Summary: std::tuple<>::swap missing constexpr specifier
           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: ---

#include <tuple>

constexpr bool b = [] {
  std::tuple<> x, y;
  x.swap(y);
  return true;
}();

https://godbolt.org/z/Gac17hjen

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
@ 2021-09-10  8:26 ` hewillk at gmail dot com
  2021-09-10  8:35 ` redi at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hewillk at gmail dot com @ 2021-09-10  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from 康桓瑋 <hewillk at gmail dot com> ---
This is missing from r278331.

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
  2021-09-10  8:26 ` [Bug libstdc++/102270] " hewillk at gmail dot com
@ 2021-09-10  8:35 ` redi at gcc dot gnu.org
  2021-09-10 15:37 ` hewillk at gmail dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2021-09-10  8:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-09-10
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
  2021-09-10  8:26 ` [Bug libstdc++/102270] " hewillk at gmail dot com
  2021-09-10  8:35 ` redi at gcc dot gnu.org
@ 2021-09-10 15:37 ` hewillk at gmail dot com
  2021-09-16 22:07 ` cvs-commit at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hewillk at gmail dot com @ 2021-09-10 15:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from 康桓瑋 <hewillk at gmail dot com> ---
In addition, the uses-allocator construction version also missing constexpr
specifier, but I don't know if this is intentional.

#include <tuple>
#include <memory>

struct O {
  using allocator_type = std::allocator<int>;
  O() = default;
  constexpr O(const allocator_type&) {}
};

constexpr std::allocator<int> a;
constexpr std::tuple<O> t(std::allocator_arg, a);

https://godbolt.org/z/ba61nWhYx

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
                   ` (2 preceding siblings ...)
  2021-09-10 15:37 ` hewillk at gmail dot com
@ 2021-09-16 22:07 ` cvs-commit at gcc dot gnu.org
  2021-09-16 22:11 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-16 22:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:734b2c2eedca50d966e22540fc136158c3633393

commit r12-3592-g734b2c2eedca50d966e22540fc136158c3633393
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Sep 15 21:53:35 2021 +0100

    libstdc++: Add missing 'constexpr' to std::tuple [PR102270]

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/102270
            * include/std/tuple (_Head_base, _Tuple_impl): Add
            _GLIBCXX20_CONSTEXPR to allocator-extended constructors.
            (tuple<>::swap(tuple&)): Add _GLIBCXX20_CONSTEXPR.
            * testsuite/20_util/tuple/cons/102270.C: New test.

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
                   ` (3 preceding siblings ...)
  2021-09-16 22:07 ` cvs-commit at gcc dot gnu.org
@ 2021-09-16 22:11 ` redi at gcc dot gnu.org
  2021-09-17  1:39 ` hewillk at gmail dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2021-09-16 22:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.4

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
                   ` (4 preceding siblings ...)
  2021-09-16 22:11 ` redi at gcc dot gnu.org
@ 2021-09-17  1:39 ` hewillk at gmail dot com
  2021-09-17 19:45 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hewillk at gmail dot com @ 2021-09-17  1:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to CVS Commits from comment #3)
> The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
> 
> https://gcc.gnu.org/g:734b2c2eedca50d966e22540fc136158c3633393
> 
> commit r12-3592-g734b2c2eedca50d966e22540fc136158c3633393
> Author: Jonathan Wakely <jwakely@redhat.com>
> Date:   Wed Sep 15 21:53:35 2021 +0100
> 
>     libstdc++: Add missing 'constexpr' to std::tuple [PR102270]
>     
>     Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
>     
>     libstdc++-v3/ChangeLog:
>     
>             PR libstdc++/102270
>             * include/std/tuple (_Head_base, _Tuple_impl): Add
>             _GLIBCXX20_CONSTEXPR to allocator-extended constructors.
>             (tuple<>::swap(tuple&)): Add _GLIBCXX20_CONSTEXPR.
>             * testsuite/20_util/tuple/cons/102270.C: New test.

tuple#L332:

template<typename _Alloc>
  _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
            const _Head& __head, const _Tail&... __tail)
  : _Inherited(__tag, __a, __tail...),
  _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head)
  { }

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
                   ` (5 preceding siblings ...)
  2021-09-17  1:39 ` hewillk at gmail dot com
@ 2021-09-17 19:45 ` cvs-commit at gcc dot gnu.org
  2021-09-18 15:04 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-17 19:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:1fa2c5a695bb962ffcf8abed49f69cdcc59d0e61

commit r12-3637-g1fa2c5a695bb962ffcf8abed49f69cdcc59d0e61
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Sep 17 12:27:02 2021 +0100

    libstdc++: Fix last std::tuple constructor missing 'constexpr' [PR102270]

    Also rename the test so it actually runs.

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/102270
            * include/std/tuple (_Tuple_impl): Add constexpr to constructor
            missed in previous patch.
            * testsuite/20_util/tuple/cons/102270.C: Moved to...
            * testsuite/20_util/tuple/cons/102270.cc: ...here.
            * testsuite/util/testsuite_allocator.h (SimpleAllocator): Add
            constexpr to constructor so it can be used for C++20 tests.

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
                   ` (6 preceding siblings ...)
  2021-09-17 19:45 ` cvs-commit at gcc dot gnu.org
@ 2021-09-18 15:04 ` redi at gcc dot gnu.org
  2021-10-12 10:58 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2021-09-18 15:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think that constructor could just be deleted, but it's fixed now. Thanks.

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
                   ` (7 preceding siblings ...)
  2021-09-18 15:04 ` redi at gcc dot gnu.org
@ 2021-10-12 10:58 ` cvs-commit at gcc dot gnu.org
  2021-10-12 10:58 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-12 10:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 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:63d91069ba8a9f1dc8bfa56ebfc10903a999f1cb

commit r11-9104-g63d91069ba8a9f1dc8bfa56ebfc10903a999f1cb
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Sep 15 21:53:35 2021 +0100

    libstdc++: Add missing 'constexpr' to std::tuple [PR102270]

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/102270
            * include/std/tuple (_Head_base, _Tuple_impl): Add
            _GLIBCXX20_CONSTEXPR to allocator-extended constructors.
            (tuple<>::swap(tuple&)): Add _GLIBCXX20_CONSTEXPR.
            * testsuite/20_util/tuple/cons/102270.C: New test.

    (cherry picked from commit 734b2c2eedca50d966e22540fc136158c3633393)

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
                   ` (8 preceding siblings ...)
  2021-10-12 10:58 ` cvs-commit at gcc dot gnu.org
@ 2021-10-12 10:58 ` cvs-commit at gcc dot gnu.org
  2021-11-26 16:34 ` cvs-commit at gcc dot gnu.org
  2021-11-26 16:44 ` redi at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-12 10:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 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:9c2eea2841aa2ca165b9055763fffcee5008bf83

commit r11-9105-g9c2eea2841aa2ca165b9055763fffcee5008bf83
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Sep 17 12:27:02 2021 +0100

    libstdc++: Fix last std::tuple constructor missing 'constexpr' [PR102270]

    Also rename the test so it actually runs.

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/102270
            * include/std/tuple (_Tuple_impl): Add constexpr to constructor
            missed in previous patch.
            * testsuite/20_util/tuple/cons/102270.C: Moved to...
            * testsuite/20_util/tuple/cons/102270.cc: ...here.
            * testsuite/util/testsuite_allocator.h (SimpleAllocator): Add
            constexpr to constructor so it can be used for C++20 tests.

    (cherry picked from commit 1fa2c5a695bb962ffcf8abed49f69cdcc59d0e61)

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
                   ` (9 preceding siblings ...)
  2021-10-12 10:58 ` cvs-commit at gcc dot gnu.org
@ 2021-11-26 16:34 ` cvs-commit at gcc dot gnu.org
  2021-11-26 16:44 ` redi at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-26 16:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:b3f135a50c3dd7fc04252e17d7fbb08ca95aa9a5

commit r10-10307-gb3f135a50c3dd7fc04252e17d7fbb08ca95aa9a5
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Sep 15 21:53:35 2021 +0100

    libstdc++: Add missing 'constexpr' to std::tuple [PR102270]

    This backport to gcc-10 also includes r12-3637.

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/102270
            * include/std/tuple (_Head_base, _Tuple_impl): Add
            _GLIBCXX20_CONSTEXPR to allocator-extended constructors.
            (tuple<>::swap(tuple&)): Add _GLIBCXX20_CONSTEXPR.
            * testsuite/20_util/tuple/cons/102270.cc: New test.
            * testsuite/util/testsuite_allocator.h (SimpleAllocator): Add
            constexpr to constructor so it can be used for C++20 tests.

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

* [Bug libstdc++/102270] std::tuple<>::swap missing constexpr specifier
  2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
                   ` (10 preceding siblings ...)
  2021-11-26 16:34 ` cvs-commit at gcc dot gnu.org
@ 2021-11-26 16:44 ` redi at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-26 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed for 11.3 and 10.4

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

end of thread, other threads:[~2021-11-26 16:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10  8:10 [Bug libstdc++/102270] New: std::tuple<>::swap missing constexpr specifier hewillk at gmail dot com
2021-09-10  8:26 ` [Bug libstdc++/102270] " hewillk at gmail dot com
2021-09-10  8:35 ` redi at gcc dot gnu.org
2021-09-10 15:37 ` hewillk at gmail dot com
2021-09-16 22:07 ` cvs-commit at gcc dot gnu.org
2021-09-16 22:11 ` redi at gcc dot gnu.org
2021-09-17  1:39 ` hewillk at gmail dot com
2021-09-17 19:45 ` cvs-commit at gcc dot gnu.org
2021-09-18 15:04 ` redi at gcc dot gnu.org
2021-10-12 10:58 ` cvs-commit at gcc dot gnu.org
2021-10-12 10:58 ` cvs-commit at gcc dot gnu.org
2021-11-26 16:34 ` cvs-commit at gcc dot gnu.org
2021-11-26 16:44 ` 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).