https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89532
Bug ID: 89532
Summary: internal compiler error: in
type_has_nontrivial_copy_init, at cp/tree.c:4024
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
Created attachment 45849
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45849&action=edit
testcase
Compiling the attached .ii file with -std=gnu++2a causes an ICE. The code has a
circular include, so the std::tuple type is not defined before it's used, so
the code is invalid. I haven't tried to reduce it.
I'm using:
gcc version 9.0.1 20190227 (experimental)
In file included from flat_map:44,
from flat_map.cc:1:
/home/jwakely/gcc/9/include/c++/9.0.1/bits/uses_allocator.h: In function
'constexpr auto std::__uses_alloc_piecewise_args(const _Alloc&, _Tuple1&&,
_Tuple2&&)':
/home/jwakely/gcc/9/include/c++/9.0.1/bits/uses_allocator.h:285:19: error:
'make_tuple' is not a member of 'std'
/home/jwakely/gcc/9/include/c++/9.0.1/bits/uses_allocator.h:241:1: note:
'std::make_tuple' is defined in header '<tuple>'; did you forget to '#include
<tuple>'?
/home/jwakely/gcc/9/include/c++/9.0.1/bits/uses_allocator.h:286:9: error:
'apply' is not a member of 'std'
/home/jwakely/gcc/9/include/c++/9.0.1/bits/uses_allocator.h:290:9: error:
'apply' is not a member of 'std'
/home/jwakely/gcc/9/include/c++/9.0.1/bits/uses_allocator.h: At global scope:
/home/jwakely/gcc/9/include/c++/9.0.1/bits/uses_allocator.h:313:65: error:
invalid use of incomplete type 'class std::tuple<>'
In file included from /home/jwakely/gcc/9/include/c++/9.0.1/bits/move.h:55,
from /home/jwakely/gcc/9/include/c++/9.0.1/bits/stl_pair.h:59,
from /home/jwakely/gcc/9/include/c++/9.0.1/utility:70,
from /home/jwakely/gcc/9/include/c++/9.0.1/algorithm:60,
from flat_map:36,
from flat_map.cc:1:
/home/jwakely/gcc/9/include/c++/9.0.1/type_traits:2511:11: note: declaration of
'class std::tuple<>'
2511 | class tuple;
| ^~~~~
In file included from flat_map:44,
from flat_map.cc:1:
/home/jwakely/gcc/9/include/c++/9.0.1/bits/uses_allocator.h:313:65: internal
compiler error: in type_has_nontrivial_copy_init, at cp/tree.c:4024
0x6559ce type_has_nontrivial_copy_init(tree_node const*)
/home/jwakely/src/gcc/gcc/gcc/cp/tree.c:4024
0x9f169b build_target_expr_with_type(tree_node*, tree_node*, int)
/home/jwakely/src/gcc/gcc/gcc/cp/tree.c:800
0x9c52e3 finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
/home/jwakely/src/gcc/gcc/gcc/cp/semantics.c:2866
0x931c6b cp_parser_functional_cast
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:28237
0x943297 cp_parser_postfix_expression
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:7098
0x950cb6 cp_parser_unary_expression
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:8469
0x92c71f cp_parser_cast_expression
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:9355
0x92cf2a cp_parser_binary_expression
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:9457
0x92de69 cp_parser_assignment_expression
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:9754
0x9312d0 cp_parser_parenthesized_expression_list
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:7902
0x942e51 cp_parser_postfix_expression
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:7248
0x944254 cp_parser_decltype_expr
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:14530
0x944254 cp_parser_decltype
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:14626
0x941cc7 cp_parser_simple_type_specifier
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:17666
0x9389b5 cp_parser_type_specifier
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:17448
0x94cf78 cp_parser_type_specifier_seq
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:21903
0x94a0a4 cp_parser_type_id_1
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:21732
0x949e1f cp_parser_trailing_type_id
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:21838
0x949e1f cp_parser_late_return_type_opt
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:21642
0x949e1f cp_parser_direct_declarator
/home/jwakely/src/gcc/gcc/gcc/cp/parser.c:20777
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.