From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6262F3857814; Thu, 13 May 2021 11:12:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6262F3857814 From: "andreemalcher at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100583] New: [modules] ICE when importing Date: Thu, 13 May 2021 11:12:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andreemalcher 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: Thu, 13 May 2021 11:12:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100583 Bug ID: 100583 Summary: [modules] ICE when importing Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: andreemalcher at gmail dot com Target Milestone: --- $ g++ --version g++ (Ubuntu 11.1.0-1ubuntu1~18.04.1) 11.1.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions.=C2=A0 There i= s NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cat span.cpp import ; void foo() { std::span s; } $ g++ -fmodules-ts -std=3Dc++20 -c -x c++-system-header span $ g++ -fmodules-ts -std=3Dc++20 -c span.cpp In module /usr/include/c++/11/span, imported at span.cpp:1: /usr/include/c++/11/span: In instantiation of =E2=80=98class std::span= =E2=80=99: span.cpp:4:29: =C2=A0 required from here /usr/include/c++/11/span:155:9: internal compiler error: Segmentation fault =C2=A0 155 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 span(_It __first, size_type __coun= t) =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~ 0x1702697 internal_error(char const*, ...) =C2=A0 =C2=A0 =C2=A0 =C2=A0 ???:0 0x7bfc52 instantiate_class_template(tree_node*) =C2=A0 =C2=A0 =C2=A0 =C2=A0 ???:0 0x7f17ab complete_type(tree_node*) =C2=A0 =C2=A0 =C2=A0 =C2=A0 ???:0 0x6af20b start_decl_1(tree_node*, bool) =C2=A0 =C2=A0 =C2=A0 =C2=A0 ???:0 0x6c1e0f start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) =C2=A0 =C2=A0 =C2=A0 =C2=A0 ???:0 0x7888ee c_parse_file() =C2=A0 =C2=A0 =C2=A0 =C2=A0 ???:0 0x85988d c_common_parse_file() =C2=A0 =C2=A0 =C2=A0 =C2=A0 ???:0 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. Even if import is replaced with=C2=A0#include , the sheer pres= ence of span.gcm leads to an ICE when compiled with=C2=A0-fmodules-ts. The solution= is to use the include and remove the gcm file altogether.But this means that ther= e is no way of importing =C2=A0as a module.=