public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107470] New: GCC falsely accepts friend declaration with mismatching requirements
@ 2022-10-31 13:46 h2+bugs at fsfe dot org
  2022-10-31 16:57 ` [Bug c++/107470] " ppalka at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: h2+bugs at fsfe dot org @ 2022-10-31 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107470
           Summary: GCC falsely accepts friend declaration with
                    mismatching requirements
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: h2+bugs at fsfe dot org
  Target Milestone: ---

#include <concepts>

template <std::integral T>
    requires std::unsigned_integral<T>
struct S
{
    template <std::integral T2> // template <typename T2>
    friend class S;
};

int main()
{
    S<unsigned> s;
}


The code is accepted by GCC and rejected by clang. However, if the friend
declaration is fully unconstrained, it is also rejected by GCC.

Code like this exists in libstdc++ which clang stumbles over (I will create a
separate library issue for that).

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

* [Bug c++/107470] GCC falsely accepts friend declaration with mismatching requirements
  2022-10-31 13:46 [Bug c++/107470] New: GCC falsely accepts friend declaration with mismatching requirements h2+bugs at fsfe dot org
@ 2022-10-31 16:57 ` ppalka at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-10-31 16:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
dup

*** This bug has been marked as a duplicate of bug 96830 ***

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

end of thread, other threads:[~2022-10-31 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 13:46 [Bug c++/107470] New: GCC falsely accepts friend declaration with mismatching requirements h2+bugs at fsfe dot org
2022-10-31 16:57 ` [Bug c++/107470] " 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).