From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE9463858D1E; Sun, 26 Feb 2023 23:18:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE9463858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677453523; bh=DLoLRsQ9PDgYtaZi4y5o0na7krXtNmExF+pIjvaVA1E=; h=From:To:Subject:Date:From; b=HpefJTY+CQ6P3dihBz3r596I3dXilCrX+1/ZA2DqqV6f3puBt1yn2O/T3UaRrTBOg /KnRD+zEqWX6KphZbe+ARod/n8ok5Us62sUSo/s2iSQBt9SV+u1cLg7xysM5UDhIzp njpfuXgD4Zr+gD7I2EkiQSqjuTkRGNdM4Qs7OLok= From: "movaki1751 at vootin dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108936] New: internal compiler error: in type_has_nontrivial_copy_init, at cp/tree.cc:4525 Date: Sun, 26 Feb 2023 23:18:43 +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: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: movaki1751 at vootin 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 attachments.created 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108936 Bug ID: 108936 Summary: internal compiler error: in type_has_nontrivial_copy_init, at cp/tree.cc:4525 Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: movaki1751 at vootin dot com Target Milestone: --- Created attachment 54538 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54538&action=3Dedit The attachment was generated with the "-freport-bug" option. It contains all the required technical information and the preprocessed file Trying to use "(union{short s;char c;}){1}.c !=3D 1;" in a constexpr to det= ermine host byte order Expected behavior: error: accessing =E2=80=98::c=E2=80=99 member instead of ini= tialized =E2=80=98::s=E2=80=99 member in constant expression 6 | static constexpr bool BigEndianHost =3D (union{short s;char c;}= ){1}.c !=3D 1; Actual behavior: internal compiler error: in type_has_nontrivial_copy_init, at cp/tree.cc:45= 25 6 | static constexpr bool BigEndianHost =3D (union{short s;char c;}){1}.c !=3D 1; If i remove "template" from the example code (= see attachment), i get the expected behavior The exact version of GCC, and other required information is in the attachme= nt=