From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7F8343857C6F; Tue, 13 Oct 2020 19:04:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F8343857C6F From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97407] New: Expanding alias template in concept satisfaction error is undesirable Date: Tue, 13 Oct 2020 19:04:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Tue, 13 Oct 2020 19:04:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97407 Bug ID: 97407 Summary: Expanding alias template in concept satisfaction error is undesirable Product: gcc Version: 10.2.1 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- Compiling this with -std=3Dc++20: #include template concept False =3D false; template requires False> void f(R&) { } int main() { int a[2]; f(a); } Produces the expected error: alias.C: In function =E2=80=98int main()=E2=80=99: alias.C:13:6: error: use of function =E2=80=98void f(R&) [with R =3D int [2= ]]=E2=80=99 with unsatisfied constraints alias.C:7:6: note: declared here alias.C:7:6: note: constraints not satisfied alias.C: In instantiation of =E2=80=98void f(R&) [with R =3D int [2]]=E2=80= =99: alias.C:13:6: required from here alias.C:3:30: required for the satisfaction of =E2=80=98False()))>=E2=80=99 [with _Co= ntainer =3D int[2]] alias.C:3:38: note: the expression =E2=80=98false=E2=80=99 evaluated to =E2= =80=98false=E2=80=99 However the second to last line refers to std::__detail::__ranges_begin(declval<_Container&>())) This is meaningless to users, and "_Container" is not used in the definitio= ns of ranges::iterator_t or anything it uses. The compiler seems drunk and is remembering the template argument of a different, unrelated use of the same alias template. That's probably PR 95310. I think it would be better to leave that alias unexpanded, as std::ranges::iterator_t.=