From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B7FD13846410; Wed, 24 Apr 2024 21:31:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7FD13846410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713994318; bh=+NttRb+ATt8z4iyUT7/LUKkELIatfCEUOeOgRLtud8I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dLF4MR/UAiTzo9IshUtodxxoDxXqqNrelIGpTi74N21fnsL4zS6VYuadBcLK2MUeR yikw1lV6JWcWxJGPl1ZlpVOA3I4vVETePkGdDTgay5K39tdbIO/CO6nsjEVyRfkspL 8evBwGnHwmMC63AGpyIgb6SaxpGCw1ktQtbXb3Bo= 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:31:57 +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: cc 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 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #6 from Patrick Palka --- It seems reasonable for this to work but there might be a defect, or at lea= st lack of clarity, in the standard in this situation. 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 always wr= itten like operator expressions, e.g. x_i <=3D> y_i then if x_i / y_i are base cl= ass 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 written A::operator<=3D>(b) as mentioned in com= ment #2 in order for the definition to be valid IIUC?=