From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AC7B63858001; Sat, 15 May 2021 18:59:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC7B63858001 From: "amorvincitomnia.iw at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100616] New: [modules] ICE when a class template taking a non-type template argument is used both inside and outside the defining module Date: Sat, 15 May 2021 18:59:35 +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: 11.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amorvincitomnia.iw 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 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: Sat, 15 May 2021 18:59:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100616 Bug ID: 100616 Summary: [modules] ICE when a class template taking a non-type template argument is used both inside and outside the defining module Product: gcc Version: 11.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: amorvincitomnia.iw at gmail dot com Target Milestone: --- See it live: https://wandbox.org/permlink/QUKvRN5GI1feSldA Minimal code to reproduce ICE: // test.cc export module test; export { struct A{}; template struct C { }; C c1; } // prog.cc import test; C<1> c2; Compile this with: $ g++ "-std=3Dc++20" "-fmodules-ts" "test.cc" "prog.cc" Generates: In module test, imported at prog.cc:2: test.cc: In instantiation of 'struct C@test<1>': prog.cc:3:6: required from here test.cc:8:12: internal compiler error: Segmentation fault 8 | struct C { | ^ 0xcac40f crash_signal ../../source/gcc/toplev.c:327 0x7e6673 comptypes(tree_node*, tree_node*, int) ../../source/gcc/cp/typeck.c:1544 0x7e6673 comptypes(tree_node*, tree_node*, int) ../../source/gcc/cp/typeck.c:1527 0x6a894f complete_vars(tree_node*) ../../source/gcc/cp/decl.c:17761 0x65f97b finish_struct_1(tree_node*) ../../source/gcc/cp/class.c:7505 0x7b1014 instantiate_class_template_1 ../../source/gcc/cp/pt.c:12248 0x7b1e42 instantiate_class_template(tree_node*) ../../source/gcc/cp/pt.c:12288 0x7e380b complete_type(tree_node*) ../../source/gcc/cp/typeck.c:143 0x7e380b complete_type(tree_node*) ../../source/gcc/cp/typeck.c:111 0x6a1aeb start_decl_1(tree_node*, bool) ../../source/gcc/cp/decl.c:5677 0x6b283f start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../source/gcc/cp/decl.c:5643 0x771343 cp_parser_init_declarator ../../source/gcc/cp/parser.c:21759 0x74fac4 cp_parser_simple_declaration ../../source/gcc/cp/parser.c:14464 0x779cb5 cp_parser_declaration ../../source/gcc/cp/parser.c:14161 0x77a98e cp_parser_toplevel_declaration ../../source/gcc/cp/parser.c:14190 0x77a98e cp_parser_translation_unit ../../source/gcc/cp/parser.c:4942 0x77a98e c_parse_file() ../../source/gcc/cp/parser.c:45372 0x84b46d c_common_parse_file() ../../source/gcc/c-family/c-opts.c:1218 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. Reproduces in both g++ 11.1.0 and 12.0.0 20210510.=