From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B7BB53858C2F; Thu, 10 Nov 2022 12:50:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7BB53858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668084607; bh=sDSnOrDt3EWPUZ99q71pN/nrLDtC8wm13fM/gbERm4w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RX2Zo+3WR35HkD9oLUUYHqb/n5WUKrjw1wCK2DBSyio6XGUviW9osXxHmoBwry7cP Of+icu3SKqdU/7eMz3WpXXqnx9rZ2eV9hJbCR1FhIdAPNOCW9sQbKWDYadzDor7nOp JE6xtIlcsh0Qj3Y6XuUCPsbpmp/GIpcUzPO1tMg4= From: "jlame646 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107605] GCC rejects valid program involving requires-clause Date: Thu, 10 Nov 2022 12:50:03 +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: 13.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jlame646 at gmail dot com X-Bugzilla-Status: NEW 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: short_desc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107605 Jason Liam changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|GCC rejects valid program |GCC rejects valid program |involving std::bind and |involving requires-clause |requires | --- Comment #2 from Jason Liam --- (In reply to Jonathan Wakely from comment #1) > This has nothing to do with std::bind. >=20 Yes i know this has nothing to do with `std::bind`. For example, I created = the following demo that reproduces the same error without std::bind. See demo: https://godbolt.org/z/K6jKqsGx5 . I also mentioned the same in one of my comments here: https://stackoverflow.com/questions/74385849/clang-accepts-program-involvin= g-requires-constraint-while-gcc-and-msvc-rejects-i/74386905#comment13131927= 8_74385849 . I've edited the title of this bug. ``` template =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 class myclass {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 public:=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 void func(const T&) requires true { std::cout << "true"; } void func(const T&) requires false { std::cout << "false"; } };=20=20=20=20=20=20 template=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 void bar(T&& ) { } int main(){=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 myclass obj;=20 bar(&myclass::func); //accepted by clang but rejected by gcc and msv= c=20=20=20=20 }=20=20 ```=