From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ED6B43857C63; Sat, 13 Mar 2021 11:44:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED6B43857C63 From: "niancw29 at 163 dot com" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBjKysvOTk1NzNdIE5ldzogSUNFIGluIG1vZHVsZTogaW50?= =?UTF-8?B?ZXJuYWwgY29tcGlsZXIgZXJyb3I6IHRyZWUgY2hlY2s6IGV4cGVjdGVkIGNs?= =?UTF-8?B?YXNzIOKAmHR5cGXigJksIGhhdmUg4oCYZXhjZXB0aW9uYWzigJkgKGVycm9y?= =?UTF-8?B?X21hcmspIGluIHN0YXJ0X2VudW0sIGF0IGNwL2RlY2wuYzoxNTY2Mw==?= Date: Sat, 13 Mar 2021 11:44:59 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: niancw29 at 163 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 attachments.created 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, 13 Mar 2021 11:45:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99573 Bug ID: 99573 Summary: ICE in module: internal compiler error: tree check: expected class =E2=80=98type=E2=80=99, have =E2=80=98ex= ceptional=E2=80=99 (error_mark) in start_enum, at cp/decl.c:15663 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: niancw29 at 163 dot com Target Milestone: --- Created attachment 50380 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50380&action=3Dedit obj-some-std.ii and obj-main.ii There are two files: // some-std.cc export module A; #include // main.cpp import A; int main(){} I know it won't compile, but it introduces an ICE. Compiling with -------------------------------------------------- g++ -fmodules-ts -std=3Dc++20 some-std.cc main.cpp -o obj -------------------------------------------------- then I reproduce it. Here is the total output using "g++ -v": -------------------------------------------------- Using built-in specs. COLLECT_GCC=3Dg++ COLLECT_LTO_WRAPPER=3D/usr/local/libexec/gcc/x86_64-pc-linux-gnu/11.0.1/lto= -wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.1 20210308 (experimental) (GCC)=20 -------------------------------------------------- In file included from /usr/local/include/c++/11.0.1/string:38, from some-std.cc:3: /usr/local/include/c++/11.0.1/bits/stl_iterator_base_funcs.h: In function =E2=80=98constexpr void std::__advance(_InputIterator&, _Distance, std::input_iterator_tag)=E2=80=99: /usr/local/include/c++/11.0.1/bits/stl_iterator_base_funcs.h:151:7: error: block-scope extern declaration =E2=80=98void std::__failed_assertion()=E2= =80=99 not permitted in module purview 151 | __glibcxx_assert(__n >=3D 0); | ^~~~~~~~~~~~~~~~ In file included from /usr/local/include/c++/11.0.1/bits/stl_iterator.h:81, from /usr/local/include/c++/11.0.1/bits/stl_algobase.h:67, from /usr/local/include/c++/11.0.1/bits/char_traits.h:39, from /usr/local/include/c++/11.0.1/string:40, from some-std.cc:3: /usr/local/include/c++/11.0.1/new: At global scope: /usr/local/include/c++/11.0.1/new:89:27: error: cannot define =E2=80=98enum= class std::align_val_t=E2=80=99 in different module 89 | enum class align_val_t: size_t {}; | ^~~~~~ : note: declared here /usr/local/include/c++/11.0.1/new:89:27: internal compiler error: tree chec= k: expected class =E2=80=98type=E2=80=99, have =E2=80=98exceptional=E2=80=99 (= error_mark) in start_enum, at cp/decl.c:15663 0x833681 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc/gcc/tree.c:9864 0x66bb45 tree_class_check(tree_node*, tree_code_class, char const*, int, ch= ar const*) ../../gcc/gcc/tree.h:3476 0x66bb45 start_enum(tree_node*, tree_node*, tree_node*, tree_node*, bool, bool*) ../../gcc/gcc/cp/decl.c:15663 0xa63207 cp_parser_enum_specifier ../../gcc/gcc/cp/parser.c:19965 0xa63207 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:18391 0xa63ef9 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:15041 0xa64cd1 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:14298 0xa919d5 cp_parser_declaration ../../gcc/gcc/cp/parser.c:14116 0xa91309 cp_parser_toplevel_declaration ../../gcc/gcc/cp/parser.c:14145 0xa91309 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:13933 0xa917a2 cp_parser_namespace_body ../../gcc/gcc/cp/parser.c:20433 0xa917a2 cp_parser_namespace_definition ../../gcc/gcc/cp/parser.c:20411 0xa91ef8 cp_parser_declaration ../../gcc/gcc/cp/parser.c:14096 0xa91309 cp_parser_toplevel_declaration ../../gcc/gcc/cp/parser.c:14145 0xa91309 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:13933 0xa92c85 cp_parser_linkage_specification ../../gcc/gcc/cp/parser.c:15309 0xa91aea cp_parser_declaration ../../gcc/gcc/cp/parser.c:14035 0xa9274c cp_parser_toplevel_declaration ../../gcc/gcc/cp/parser.c:14145 0xa9274c cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4936 0xa9274c c_parse_file() ../../gcc/gcc/cp/parser.c:45231 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. --------------------------------------------------=