public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103540] New: diagnosting concept depends on itself
@ 2021-12-03 14:05 ich.freak at gmx dot net
  2021-12-03 22:10 ` [Bug c++/103540] " redi at gcc dot gnu.org
  2021-12-05 16:04 ` ich.freak at gmx dot net
  0 siblings, 2 replies; 3+ messages in thread
From: ich.freak at gmx dot net @ 2021-12-03 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103540
           Summary: diagnosting concept depends on itself
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ich.freak at gmx dot net
  Target Milestone: ---

When a concept X is checked for a template parameter T, this parameter is fully
instanciated.
(while this may not be necessary to check the concept, this seems to be
dictated by the standard if I understood correctly)
If the instanciation of T depends on the concept X<T>, then gcc refuses to
compile the code saying something like
"satisfaction of atomic constraint X<T> depends on itself".
If T is large, however, it may be very difficult to determine where exactly T
depends on X<T> and gcc currently does not help at all to find the problem.
It would be nice if gcc could tell the reader something like "X<T> depends on
itself because the type T::something declared in line Z depends on X<T>"

I prepared a small example here <https://godbolt.org/z/q9KczYb16>. Note that
diagnostics end with

<source>:5:14: note: the required type 'typename N::something' is invalid,
because
    5 |     typename N::something;
      |     ~~~~~~~~~^~~~~~~~~~~~~
Compiler returned: 1

leaving the reader to wonder "because of what?"

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

end of thread, other threads:[~2021-12-05 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 14:05 [Bug c++/103540] New: diagnosting concept depends on itself ich.freak at gmx dot net
2021-12-03 22:10 ` [Bug c++/103540] " redi at gcc dot gnu.org
2021-12-05 16:04 ` ich.freak at gmx dot net

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).