From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 05ECB3858C60; Sun, 5 Dec 2021 16:04:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05ECB3858C60 From: "ich.freak at gmx dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103540] diagnosting concept depends on itself Date: Sun, 05 Dec 2021 16:04:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: ich.freak at gmx dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2021 16:04:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103540 --- Comment #2 from Igel --- Ah thanks for copying the relevant code here. The error that you're referri= ng to is: : In instantiation of 'struct X<0>': :5:14: required by substitution of 'template requires=20 StrictNodeType using Int =3D int [with N =3D X<0>]' :15:27: required from here :12:11: error: template constraint failure for 'template=20 requires StrictNodeType using Int =3D int' 12 | using something =3D Int; | ^~~~~~~~~ :12:11: note: constraints not satisfied I guess technically, you're right that it points to the correct spot and it= is the programmers duty to translate this into "the concept StrictNodeType> depends on itself because the type X<0>::something (also known as Int>) declared in line 12 depends on the concept StrictNodeType>". However, this information can be buried arbitrarily deep in the error messa= ges. Consider, for example, the following adaptation: #include template concept StrictNodeType =3D requires { typename N::something; }; template using Int =3D int;=20 template class P, class Q> using chooser =3D P; template struct X { using something =3D chooser; }; using ThisBreaks =3D Int>; The only hint towards the real problem (gcc cannot tell if X<0> has a type called 'something' or not) is now this: :14:18: required from 'struct X<0>' I guess all I'm saying is that extracting the site of the problematic code = is currently very hard for "depends on itself"-errors.=