From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 587A43858D28; Mon, 6 May 2024 00:53:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 587A43858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714956800; bh=awP8SRTHIHV2MJCC/9grKfj7QGedlh0W2TJRfmj1pv4=; h=From:To:Subject:Date:From; b=oRZJhGNA/YmK35kACGgn9Yzb01Qo2+OCMOoud71I3jcQEcnUVDqhO37R01MHl4omJ s2Bu7ZLYh98yAXUi9Tzj71UP8+HA2tFelk0oeda/c297Kl8XdNkEZZojp/cxapr8OW Vp84LkV6O/Ux6FdPyKopMhlf6ANRhFpHRNs9ZOBs= From: "nshead at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114954] New: [modules] ICE in write_class_def with templated union type Date: Mon, 06 May 2024 00:53:19 +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: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nshead 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter blocked 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114954 Bug ID: 114954 Summary: [modules] ICE in write_class_def with templated union type Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nshead at gcc dot gnu.org Blocks: 103524 Target Milestone: --- The following sample crashes on trunk: export module main; template union U { private: char a[N + 1]; int b; }; U<4> p; With 'g++ -fmodules-ts -S main.cpp': ~/ice/main.cpp:1:8: internal compiler error: in write_class_def, at cp/module.cc:12118 1 | export module main; | ^~~~~~ 0x1010c67 write_class_def ../../gcc/gcc/cp/module.cc:12118 0x1014d91 write_definition ../../gcc/gcc/cp/module.cc:12731 0x101880e depset::hash::find_dependencies(module_state*) ../../gcc/gcc/cp/module.cc:13640 0x1026a62 module_state::write_begin(elf_out*, cpp_reader*, module_state_config&, unsigned int&) ../../gcc/gcc/cp/module.cc:18253 0x102e39f finish_module_processing(cpp_reader*) ../../gcc/gcc/cp/module.cc:20693 0xf50556 c_parse_final_cleanups() ../../gcc/gcc/cp/decl2.cc:5393 0x131e75f c_common_parse_file() ../../gcc/gcc/c-family/c-opts.cc:1329 The assertion that fails is /* Every class but __as_base has a type-specific. */ gcc_checking_assert (!TYPE_LANG_SPECIFIC (type) =3D=3D IS_FAKE_BASE_TYPE = (type)); The issue looks to be that a union `__as_base` type doesn't satisfy the 'IS_FAKE_BASE_TYPE', which only applies to RECORD_TYPEs. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103524 [Bug 103524] [meta-bug] modules issue=