From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7380A3858401; Tue, 18 Oct 2022 12:59:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7380A3858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666097982; bh=4QxtNBgl1NZzE/eDstua4P6ZeXCvI9SCp4fDjAkM+EA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UPZbMMIrpOBBPA4n9OlW8/pbxbQQBgdAoklzlbRxaBMk7HaRUbfjACMY8dlbT8DGF Zaq3oOnCly5rzILkAFxecl8chdYgwmRdhpBB7wBE2WN3C05NwJqYuaoDsKhbFFHmPk 9MpAPB3ndYKq44z+BPr0i4kbPGeyavd6yBK0atOs= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103994] Module ICE in write_var_def with global variable in global module fragment Date: Tue, 18 Oct 2022 12:59:41 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code 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 short_desc 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=3D103994 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ppalka at gcc dot gnu.org Summary|Module ICE in |Module ICE in write_var_def |mark_by_value, at |with global variable in |cp/module.cc:4772 |global module fragment --- Comment #1 from Patrick Palka --- With trunk, it seems we now crash from write_var_def. Reduced: $ cat pr103994.C module; # 0 "" 1 struct A { A(int) { } }; const A a =3D 0; # 3 "" 2 export module pr103994; export inline A f() { return a; } $ g++ -fmodules-ts pr103994.C pr103994.C:4:8: internal compiler error: in write_var_def, at cp/module.cc:11649 4 | const A a =3D 0; | ^~~~~~=