public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace
       [not found] <bug-92944-4@http.gcc.gnu.org/bugzilla/>
@ 2020-07-29 13:32 ` redi at gcc dot gnu.org
  2021-12-14 11:22 ` ed at catmur dot uk
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2020-07-29 13:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-07-29
             Blocks|                            |67491
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
[Bug 67491] [meta-bug] concepts issues

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

* [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace
       [not found] <bug-92944-4@http.gcc.gnu.org/bugzilla/>
  2020-07-29 13:32 ` [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace redi at gcc dot gnu.org
@ 2021-12-14 11:22 ` ed at catmur dot uk
  2021-12-17 20:53 ` ed at catmur dot uk
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: ed at catmur dot uk @ 2021-12-14 11:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Ed Catmur <ed at catmur dot uk> ---
This becomes problematic when N::Q is std::hash; we are encouraged not to
reopen namespace std but to specialize std::hash from the root namespace.

Example:

#include <functional>
template<class> constexpr bool P = false;
template<class> constexpr bool Q = false;
template<class T> requires P<T> struct std::hash<T> { std::size_t operator()(T)
{ return 1; } };
template<class U> requires Q<U> struct std::hash<U> { std::size_t operator()(U)
{ return 2; } };
struct S {};
template<> constexpr bool P<S> = true;
int i = std::hash<S>()(S());

clang and MSVC correctly accept this.

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

* [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace
       [not found] <bug-92944-4@http.gcc.gnu.org/bugzilla/>
  2020-07-29 13:32 ` [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace redi at gcc dot gnu.org
  2021-12-14 11:22 ` ed at catmur dot uk
@ 2021-12-17 20:53 ` ed at catmur dot uk
  2021-12-23 12:55 ` ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: ed at catmur dot uk @ 2021-12-17 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Ed Catmur <ed at catmur dot uk> ---
Sorry, meant to link this:
https://quuxplusone.github.io/blog/2021/10/27/dont-reopen-namespace-std/

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

* [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace
       [not found] <bug-92944-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-12-17 20:53 ` ed at catmur dot uk
@ 2021-12-23 12:55 ` ppalka at gcc dot gnu.org
  2021-12-28  9:29 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-12-23 12:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |florin at iucha dot net

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 103809 has been marked as a duplicate of this bug. ***

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

* [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace
       [not found] <bug-92944-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-12-23 12:55 ` ppalka at gcc dot gnu.org
@ 2021-12-28  9:29 ` pinskia at gcc dot gnu.org
  2022-01-26 17:28 ` ppalka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-28  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fchelnokov at gmail dot com

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 103849 has been marked as a duplicate of this bug. ***

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

* [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace
       [not found] <bug-92944-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-12-28  9:29 ` pinskia at gcc dot gnu.org
@ 2022-01-26 17:28 ` ppalka at gcc dot gnu.org
  2022-01-27 16:02 ` cvs-commit at gcc dot gnu.org
  2022-01-27 16:04 ` ppalka at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-01-26 17:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org
                 CC|                            |ppalka at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

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

* [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace
       [not found] <bug-92944-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2022-01-26 17:28 ` ppalka at gcc dot gnu.org
@ 2022-01-27 16:02 ` cvs-commit at gcc dot gnu.org
  2022-01-27 16:04 ` ppalka at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-27 16:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:ce6054a22ae14594a2919d2ad87cd9478e616fb3

commit r12-6896-gce6054a22ae14594a2919d2ad87cd9478e616fb3
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Jan 27 10:56:34 2022 -0500

    c++: constrained partial spec using qualified name [PR92944, PR103678]

    In the nested_name_specifier branch within cp_parser_class_head, we need
    to update 'type' with the result of maybe_process_partial_specialization
    like we do in the template_id_p branch.

            PR c++/92944
            PR c++/103678

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_class_head): Update 'type' with the result
            of maybe_process_partial_specialization in the
            nested_name_specifier branch.  Refactor nearby code to accomodate
            that maybe_process_partial_specialization returns a _TYPE, not a
            TYPE_DECL, and eliminate local variable 'class_type' in passing.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-partial-spec10.C: New test.
            * g++.dg/cpp2a/concepts-partial-spec11.C: New test.

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

* [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace
       [not found] <bug-92944-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2022-01-27 16:02 ` cvs-commit at gcc dot gnu.org
@ 2022-01-27 16:04 ` ppalka at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-01-27 16:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |12.0

--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 12, thanks for the bug report.

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

end of thread, other threads:[~2022-01-27 16:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-92944-4@http.gcc.gnu.org/bugzilla/>
2020-07-29 13:32 ` [Bug c++/92944] [concepts] redefinition error when using constrained structure template inside namespace redi at gcc dot gnu.org
2021-12-14 11:22 ` ed at catmur dot uk
2021-12-17 20:53 ` ed at catmur dot uk
2021-12-23 12:55 ` ppalka at gcc dot gnu.org
2021-12-28  9:29 ` pinskia at gcc dot gnu.org
2022-01-26 17:28 ` ppalka at gcc dot gnu.org
2022-01-27 16:02 ` cvs-commit at gcc dot gnu.org
2022-01-27 16:04 ` 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).