From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B38C23865C2A; Thu, 29 Jul 2021 15:58:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B38C23865C2A From: "joeloser93 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101677] New: [11 Regression] Concept with use of incomplete type succeeds on GCC 10.3.0, fails on GCC 11 onward Date: Thu, 29 Jul 2021 15:58:50 +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: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joeloser93 at gmail dot com 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 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: Thu, 29 Jul 2021 15:58:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101677 Bug ID: 101677 Summary: [11 Regression] Concept with use of incomplete type succeeds on GCC 10.3.0, fails on GCC 11 onward Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: joeloser93 at gmail dot com Target Milestone: --- A concept that uses an incomplete type in testing the well-formedness of calling a function template is well-formed in GCC 10.3.0, but fails in GCC = 11 onward (including trunk at the time of this writing). For example, consider the following: template concept C_bug_with_forward_decl =3D requires(T& t){ t.template f(); }; struct good { template auto f() -> void {} }; static_assert(C_bug_with_forward_decl); // works in GCC 10.3.0, fails= on GCC 11 onward This bug can be worked around by using a complete type instead when defining the concept. For example: struct U{}; template concept C_workaround =3D requires(T& t){ t.template f(); }; static_assert(C_workaround); // works on GCC 10.3.0 and GCC 11 onward See it live at https://godbolt.org/z/h7GzqGhYn=