public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99573] New: ICE in module: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in start_enum, at cp/decl.c:15663
@ 2021-03-13 11:44 niancw29 at 163 dot com
  2021-03-30  1:13 ` [Bug c++/99573] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: niancw29 at 163 dot com @ 2021-03-13 11:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99573

            Bug ID: 99573
           Summary: ICE in module: internal compiler error: tree check:
                    expected class ‘type’, have ‘exceptional’ (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=50380&action=edit
obj-some-std.ii and obj-main.ii

There are two files:

// some-std.cc
export module A;
#include <string>

// main.cpp
import A;
int main(){}


I know it won't compile, but it introduces an ICE. Compiling with
--------------------------------------------------
g++ -fmodules-ts -std=c++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=g++
COLLECT_LTO_WRAPPER=/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) 
--------------------------------------------------
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
‘constexpr void std::__advance(_InputIterator&, _Distance,
std::input_iterator_tag)’:
/usr/local/include/c++/11.0.1/bits/stl_iterator_base_funcs.h:151:7: error:
block-scope extern declaration ‘void std::__failed_assertion()’ not permitted
in module purview
  151 |       __glibcxx_assert(__n >= 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 ‘enum class
std::align_val_t’ in different module
   89 |   enum class align_val_t: size_t {};
      |                           ^~~~~~
<built-in>: note: declared here
/usr/local/include/c++/11.0.1/new:89:27: internal compiler error: tree check:
expected class ‘type’, have ‘exceptional’ (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, char
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 <https://gcc.gnu.org/bugs/> for instructions.
--------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-11 21:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-13 11:44 [Bug c++/99573] New: ICE in module: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in start_enum, at cp/decl.c:15663 niancw29 at 163 dot com
2021-03-30  1:13 ` [Bug c++/99573] " mpolacek at gcc dot gnu.org
2021-03-30  1:17 ` mpolacek at gcc dot gnu.org
2024-02-14 11:06 ` cvs-commit at gcc dot gnu.org
2024-02-14 11:08 ` nshead at gcc dot gnu.org
2024-03-11 21:21 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).