From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DDAE43858D38; Sun, 5 Jul 2020 08:06:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DDAE43858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593936390; bh=xF/Zoa18YGsLweRkCHFe/dxHhqi78UmMXI8vDh0RAV8=; h=From:To:Subject:Date:From; b=gl2SClvk/UyyvL9wiOLCiyn6t4D2JRSJ2rk3g5WF6f7npAf1vJrZCab8ga+VFO8+4 ATmvlHhnW/91biGoU4CFLG5sNQwVKnHh1cjIVtAEnyqkW3+dE0bc2mYu5AiTGfWW+o Nb0Sx4zD7ZJu3cpH6H0FamfqCHGYK/dw7VEI6TP0= From: "milasudril at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96064] New: Defaulted constexpr spaceship operator triggers internal compiler error after including utility Date: Sun, 05 Jul 2020 08:06:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: milasudril 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Sun, 05 Jul 2020 08:06:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96064 Bug ID: 96064 Summary: Defaulted constexpr spaceship operator triggers internal compiler error after including utility Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: milasudril at gmail dot com Target Milestone: --- The following code crashes gcc-10.1 #include class WrappedValue { public: constexpr explicit WrappedValue(double val): m_value{val}{} constexpr bool operator<=3D>(WrappedValue const&) const =3D default constexpr double value() const {return m_value; } private: double m_value; }; Any of the following actions prevents the crash: * Remove `#include ` * Make `operator<=3D>` non-constexpr * Make `operator<=3D>` non-defaulted Error log: : In member function 'constexpr bool WrappedValue::operator<=3D>(co= nst WrappedValue&) const': :8:24: internal compiler error: Segmentation fault 8 | constexpr bool operator<=3D>(WrappedValue const&) const =3D default; | ^~~~~~~~ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Compiler returned: 1 On compiler explorer: https://gcc.godbolt.org/z/mo7HkG=