From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 50DDB384641C; Wed, 24 Apr 2024 21:32:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50DDB384641C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713994368; bh=A8g9DSp7nE69iU5KSD7Y6M7evp71hq0HGuvItaMKPFo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xKSgrtcu8Rdji8uHQwQSHLDRSzJh0RttCFT2oGc5Tcex40lmWa6fAIhTayVqgp2BK PBhNfdRX/YxPsDhXQswNUkzPYsZvHwBgm7FCupMfQzNPgnoKlb1qSEROK/wW3vvWG8 4SMEhMbleWMP85i1qNmq7yiO0ZMSxHgEQKqIC7wU= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94061] defaulted member operator <=> defined as deleted if a base has protected member operator <=> Date: Wed, 24 Apr 2024 21:32:47 +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: 10.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka 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: 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=3D94061 --- Comment #7 from Patrick Palka --- (In reply to Patrick Palka from comment #6) > It seems reasonable for this to work but there might be a defect, or at > least lack of clarity, in the standard in this situation. >=20 > http://eel.is/c++draft/class.spaceship#3 specifies how a defaulted <=3D> = is > defined, in terms of <=3D> comparisons of corresponding subobjects. But = it's > not clear how each of these <=3D> comparisons is written. If they're alw= ays > written like operator expressions, e.g. x_i <=3D> y_i then if x_i / y_i a= re > base class subobjects that have a protected <=3D>, then such a definition > would indeed be ill-formed due to the protected access: > https://godbolt.org/z/5h4ednq9 The <=3D> comparison would need to be wri= tten > A::operator<=3D>(b) as mentioned in comment #2 in order for the definitio= n to > be valid IIUC? Oops, the full CE link is https://godbolt.org/z/5h4ednq9E=