From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 893813858C2C; Thu, 24 Mar 2022 10:53:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 893813858C2C From: "johelegp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105044] New: [modules] ICE in comptypes, at cp/typeck.c:1529 Date: Thu, 24 Mar 2022 10:53:13 +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.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: johelegp 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 keywords 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: Thu, 24 Mar 2022 10:53:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105044 Bug ID: 105044 Summary: [modules] ICE in comptypes, at cp/typeck.c:1529 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/YGo78aPE8. `mod.cpp`: ```C++ export module mod; export template struct downcast_base { using downcast_base_type =3D BaseType; friend auto downcast_guide(downcast_base); }; export template concept Downcastable =3D true; export template struct downcast_child : T { friend auto downcast_guide(typename T::downcast_base) { return T(); } }; export struct ratio { int num; }; export template struct scaled_unit : downcast_base> {}; export template struct unit : downcast_child> {}; export struct unknown_coherent_unit : unit {}; ``` `test.cpp`: ```C++ import mod; struct u : downcast_base { }; int main() { } ``` Output: ``` In module mod, imported at /app/test.cpp:1: mod.cpp: In instantiation of 'struct downcast_base@mod': test.cpp:2:12: required from here mod.cpp:4:8: internal compiler error: in comptypes, at cp/typeck.cc:1529 4 | struct downcast_base { | ^~~~~~~~~~~~~ 0x218c519 internal_error(char const*, ...) ???:0 0x741b3f fancy_abort(char const*, int, char const*) ???:0 0xa7e346 comptypes(tree_node*, tree_node*, int) ???:0 0x828f6d complete_vars(tree_node*) ???:0 0x7a1a5c finish_struct_1(tree_node*) ???:0 0xa01359 instantiate_class_template(tree_node*) ???:0 0xa7739b complete_type_or_maybe_complain(tree_node*, tree_node*, int) ???:0 0x841a1c xref_basetypes(tree_node*, tree_node*) ???:0 0x986b0d c_parse_file() ???:0 0xb18ae2 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. ```=