public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98614] New: Copy ctor/assign cannot be defaulted in specialization by concept
@ 2021-01-10  5:12 iDingDong at outlook dot com
  2021-08-17  8:53 ` [Bug c++/98614] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: iDingDong at outlook dot com @ 2021-01-10  5:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98614
           Summary: Copy ctor/assign cannot be defaulted in specialization
                    by concept
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iDingDong at outlook dot com
  Target Milestone: ---

GCC 10.2 rejects the following piece of code:

//---
#include <concepts>

template <typename T> struct A {
        A(A<T> const&) = default;
};

template <std::same_as<int> T> struct A<T> {
        A(A<T> const&) = default;
};
//---

The error message:

> <source>:8:19: error: 'A<T>::A(const A<T>&)' cannot be defaulted

This can be reproduced by the compiler explorer: https://godbolt.org/z/1v6nPv

I can locally reproduce this with:

> g++ -std=c++20 test.cpp

This error only occurs when trying to default a copy constructor in a partial
specialization involving concept. The workaround is to omit the `<T>` in the
constructor/assignment's argument declarator.

PS: move constructor/assignment seems unaffected.

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

* [Bug c++/98614] Copy ctor/assign cannot be defaulted in specialization by concept
  2021-01-10  5:12 [Bug c++/98614] New: Copy ctor/assign cannot be defaulted in specialization by concept iDingDong at outlook dot com
@ 2021-08-17  8:53 ` pinskia at gcc dot gnu.org
  2021-12-09  7:18 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-17  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Seems to be fixed on the trunk.

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

* [Bug c++/98614] Copy ctor/assign cannot be defaulted in specialization by concept
  2021-01-10  5:12 [Bug c++/98614] New: Copy ctor/assign cannot be defaulted in specialization by concept iDingDong at outlook dot com
  2021-08-17  8:53 ` [Bug c++/98614] " pinskia at gcc dot gnu.org
@ 2021-12-09  7:18 ` pinskia at gcc dot gnu.org
  2021-12-09  9:33 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-09  7:18 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-12-09
     Ever confirmed|0                           |1
      Known to work|                            |12.0
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |11.1.0

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

* [Bug c++/98614] Copy ctor/assign cannot be defaulted in specialization by concept
  2021-01-10  5:12 [Bug c++/98614] New: Copy ctor/assign cannot be defaulted in specialization by concept iDingDong at outlook dot com
  2021-08-17  8:53 ` [Bug c++/98614] " pinskia at gcc dot gnu.org
  2021-12-09  7:18 ` pinskia at gcc dot gnu.org
@ 2021-12-09  9:33 ` marxin at gcc dot gnu.org
  2023-11-16 15:50 ` cvs-commit at gcc dot gnu.org
  2023-11-16 15:51 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-09  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
           Keywords|needs-bisection             |

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed with r12-1403-gc4e50e500da7692a.

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

* [Bug c++/98614] Copy ctor/assign cannot be defaulted in specialization by concept
  2021-01-10  5:12 [Bug c++/98614] New: Copy ctor/assign cannot be defaulted in specialization by concept iDingDong at outlook dot com
                   ` (2 preceding siblings ...)
  2021-12-09  9:33 ` marxin at gcc dot gnu.org
@ 2023-11-16 15:50 ` cvs-commit at gcc dot gnu.org
  2023-11-16 15:51 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-16 15:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:063d987af0e7a8329559fb116337bdb8ab20d8eb

commit r14-5532-g063d987af0e7a8329559fb116337bdb8ab20d8eb
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Nov 16 10:49:17 2023 -0500

    c++: add fixed testcases [PR98614, PR104802]

    Both of these PRs are fixed by r12-1403-gc4e50e500da7692a.

            PR c++/98614
            PR c++/104802

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/nontype-auto22.C: New test.
            * g++.dg/cpp2a/concepts-partial-spec14.C: New test.

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

* [Bug c++/98614] Copy ctor/assign cannot be defaulted in specialization by concept
  2021-01-10  5:12 [Bug c++/98614] New: Copy ctor/assign cannot be defaulted in specialization by concept iDingDong at outlook dot com
                   ` (3 preceding siblings ...)
  2023-11-16 15:50 ` cvs-commit at gcc dot gnu.org
@ 2023-11-16 15:51 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-11-16 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
                 CC|                            |ppalka at gcc dot gnu.org
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed since GCC 12

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

end of thread, other threads:[~2023-11-16 15:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-10  5:12 [Bug c++/98614] New: Copy ctor/assign cannot be defaulted in specialization by concept iDingDong at outlook dot com
2021-08-17  8:53 ` [Bug c++/98614] " pinskia at gcc dot gnu.org
2021-12-09  7:18 ` pinskia at gcc dot gnu.org
2021-12-09  9:33 ` marxin at gcc dot gnu.org
2023-11-16 15:50 ` cvs-commit at gcc dot gnu.org
2023-11-16 15:51 ` ppalka 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).