From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1AACC3858430; Sat, 23 Apr 2022 07:22:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AACC3858430 From: "gawain.bolton at free dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105351] [concepts] Constraint checking does correctly match static member attributes Date: Sat, 23 Apr 2022 07:22:22 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: gawain.bolton at free dot fr 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: Sat, 23 Apr 2022 07:22:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105351 --- Comment #2 from Gawain Bolton --- Yes I believe this is a bug and strangely enough clang also seems to have t= his issue. >>From the draft C++20 standard concerning "simple requirements" (cf. https://isocpp.org/files/papers/N4860.pdf page 109): A simple-requirement asserts the validity of an expression. [Note: The enclosing requires-expression will evaluate to false if substitution of template arguments into the expression fails. The expression is an unevalua= ted operand (7.2). =E2=80=94 end note] [Example: template concept C =3D requires (T a, T b) { a + b; // C is true if a + b is a valid expression }; =E2=80=94 end example] Clearly T::attr2 is not a valid expression for struct T { int attr2; }=