public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107118] New: "does not name a type" when used in constrained struct specialization
@ 2022-10-02  5:10 lhlaurini at hotmail dot com
  2022-10-03 13:52 ` [Bug c++/107118] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: lhlaurini at hotmail dot com @ 2022-10-02  5:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107118
           Summary: "does not name a type" when used in constrained struct
                    specialization
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lhlaurini at hotmail dot com
  Target Milestone: ---

This is similar to bug 92944. The following code fails to compile:

namespace N { template <class T> struct Q; struct S; }
template <class T> requires false struct N::Q<T> { S& x; };
template <class T> requires true struct N::Q<T> { S& x; };

with

<source>:3:52: error: 'S' does not name a type
    3 | template <class T> requires false struct N::Q<T> { S& x; };
      |                                                    ^

If I change it to:

namespace N { template <class T> struct Q; struct S; }
template <class T> requires false struct N::Q<T> { S& x; };
template <class T> requires true struct N::Q<T> { N::S& x; };

then it works.

Tested locally on GCC 12.2.0 and on https://godbolt.org/z/M7rEEb1Y1.

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

* [Bug c++/107118] "does not name a type" when used in constrained struct specialization
  2022-10-02  5:10 [Bug c++/107118] New: "does not name a type" when used in constrained struct specialization lhlaurini at hotmail dot com
@ 2022-10-03 13:52 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2022-10-03 13:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-10-03
           Keywords|                            |rejects-valid

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

end of thread, other threads:[~2022-10-03 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02  5:10 [Bug c++/107118] New: "does not name a type" when used in constrained struct specialization lhlaurini at hotmail dot com
2022-10-03 13:52 ` [Bug c++/107118] " 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).