[Bug c++/92496] New: spaceship operator without include<compare> produces ICE

klaus.doldinger64 at googlemail dot com gcc-bugzilla@gcc.gnu.org
Wed Nov 13 11:28:00 GMT 2019


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

            Bug ID: 92496
           Summary: spaceship operator without include<compare> produces
                    ICE
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: klaus.doldinger64 at googlemail dot com
  Target Milestone: ---

Omitting the include in the below example produces ICE

#include <compare> // omitting trigger ICE

template<auto V>
struct A {};

struct B {
    inline constexpr auto operator<=>(const B& rhs) const = default;
//private:
    int value; // why must this member be public?
};

int main() {
    A<B{}> t;
}



test93.cc: In member function 'constexpr auto B::operator<=>(const B&) const':
test93.cc:7:27: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in is_cat, at cp/method.c:999
7 |     inline constexpr auto operator<=>(const B& rhs) const = default;
|                           ^~~~~~~~
0x784e45 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/tree.c:9735
0x63398b tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc/tree.h:3396
0x63398b is_cat
../../gcc/cp/method.c:999
0x8dd5ab cat_tag_for
../../gcc/cp/method.c:1011
0x8dd5ab common_comparison_type
../../gcc/cp/method.c:1166
0x8dd5ab build_comparison_op
../../gcc/cp/method.c:1341
0x8ddf19 synthesize_method(tree_node*)
../../gcc/cp/method.c:1501
0x82d6b2 check_bases_and_members
../../gcc/cp/class.c:5909
0x82e5d3 finish_struct_1(tree_node*)
../../gcc/cp/class.c:7113
0x8300f4 finish_struct(tree_node*, tree_node*)
../../gcc/cp/class.c:7399
0x90ea44 cp_parser_class_specifier_1
../../gcc/cp/parser.c:23666
0x910981 cp_parser_class_specifier
../../gcc/cp/parser.c:23965
0x910981 cp_parser_type_specifier
../../gcc/cp/parser.c:17566
0x911956 cp_parser_decl_specifier_seq
../../gcc/cp/parser.c:14239
0x912371 cp_parser_simple_declaration
../../gcc/cp/parser.c:13502
0x9394ca cp_parser_declaration
../../gcc/cp/parser.c:13322
0x939b42 cp_parser_translation_unit
../../gcc/cp/parser.c:4721
0x939b42 c_parse_file()
../../gcc/cp/parser.c:42925
0xa3ce4b c_common_parse_file()
../../gcc/c-family/c-opts.c:1185
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.
make: *** [<eingebaut>: test93.o] Fehler 1


More information about the Gcc-bugs mailing list