From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 873D4384B07E; Mon, 23 May 2022 20:58:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 873D4384B07E From: "roi.jacobson1 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105699] [Concepts] Constrained virtual functions are accepted by GCC Date: Mon, 23 May 2022 20:58:14 +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: 12.1.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: roi.jacobson1 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: 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: Mon, 23 May 2022 20:58:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105699 --- Comment #1 from Roy Jacobson --- I want to suggest to also consider the case of overloading virtual functions with non-virtual constrained functions. There's an open CWG issue about this https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2488 and the A= BI implications are very annoying. MSVC already forbid it. It interacts very funnily with the special member functions paper (P0848). Consider template struct A { A& operator=3D(A&&) requires true; virtual A& operator=3D(A&&); }; template struct B { B& operator=3D(B&&) requires false; virtual B& operator=3D(B&&); }; template struct C { ~C() requires true; virtual ~C(); }; template struct D { ~D() requires false; virtual ~D(); }; template struct E { void foo() requires false; virtual void foo(); }; template struct F { void foo() requires false; virtual void foo(); }; Currently GCC will generate vtables for B,D, and for both E and F, which se= ems wrong. (I think C shouldn't have a vtable but A probably should have one, if I'm interpreting P0848 correctly).=