public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108936] New: internal compiler error: in type_has_nontrivial_copy_init, at cp/tree.cc:4525
@ 2023-02-26 23:18 movaki1751 at vootin dot com
  2023-02-27 15:25 ` [Bug c++/108936] " marxin at gcc dot gnu.org
  2023-02-27 18:10 ` mpolacek at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: movaki1751 at vootin dot com @ 2023-02-26 23:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108936

            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=54538&action=edit
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 != 1;" in a constexpr to determine
host byte order


Expected behavior:
error: accessing ‘<unnamed union>::c’ member instead of initialized ‘<unnamed
union>::s’ member in constant expression
    6 |     static constexpr bool BigEndianHost = (union{short s;char c;}){1}.c
!= 1;


Actual behavior:
internal compiler error: in type_has_nontrivial_copy_init, at cp/tree.cc:4525
     6 |     static constexpr bool BigEndianHost = (union{short s;char
c;}){1}.c != 1;


If i remove "template<bool BigEndianData = true>" from the example code (see
attachment), i get the expected behavior


The exact version of GCC, and other required information is in the attachment

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-27 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-26 23:18 [Bug c++/108936] New: internal compiler error: in type_has_nontrivial_copy_init, at cp/tree.cc:4525 movaki1751 at vootin dot com
2023-02-27 15:25 ` [Bug c++/108936] " marxin at gcc dot gnu.org
2023-02-27 18:10 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).