https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119580
Bug ID: 119580
Summary: ICE: tree check: expected tree_vec, have error_mark in
comp_template_args, at cp/pt.cc:9595
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: acoplan at gcc dot gnu.org
Target Milestone: ---
The following fails on the trunk:
$ cat t.cc
template <typename> struct vector;
template <class> class Optional;
class Filter;
struct ISerializable {
template <typename> static void deserialize();
template <typename T, typename>
Optional<decltype(ISerializable::deserialize<T::value_type>)> deserialize();
decltype(deserialize<vector<Filter>>()) *a;
};
$ ./xgcc -B . -c t.cc -S -o /dev/null
t.cc: In substitution of ‘template<class T, class> Optional<decltype
(ISerializable::deserialize<T::value_type>)> ISerializable::deserialize() [with
T = vector<Filter>; <template-parameter-1-2> = <missing>]’:
t.cc:8:39: required from here
8 | decltype(deserialize<vector<Filter>>()) *a;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
t.cc:7:65: internal compiler error: tree check: expected tree_vec, have
error_mark in comp_template_args, at cp/pt.cc:9595
7 | Optional<decltype(ISerializable::deserialize<T::value_type>)>
deserialize();
|
^~~~~~~~~~~
0x4629771 internal_error(char const*, ...)
$SRC/gcc/diagnostic-global-context.cc:517
0x425cc2f tree_check_failed(tree_node const*, char const*, int, char const*,
...)
$SRC/gcc/tree.cc:9114
0x1b8e281 tree_check(tree_node*, char const*, int, char const*, tree_code)
$SRC/gcc/tree.h:3692
0x1f0df1b comp_template_args(tree_node*, tree_node*, tree_node**, tree_node**)
$SRC/gcc/cp/pt.cc:9595
0x1ffa986 cp_tree_equal(tree_node*, tree_node*)
$SRC/gcc/cp/tree.cc:4177
0x1ffa695 cp_tree_equal(tree_node*, tree_node*)
$SRC/gcc/cp/tree.cc:4163
0x1ffbebf cp_tree_equal(tree_node*, tree_node*)
$SRC/gcc/cp/tree.cc:4356
0x201f8c3 structural_comptypes
$SRC/gcc/cp/typeck.cc:1639
0x201ff36 comptypes(tree_node*, tree_node*, int)
$SRC/gcc/cp/typeck.cc:1727
0x1f0dda7 template_args_equal(tree_node*, tree_node*)
$SRC/gcc/cp/pt.cc:9559
0x1f0df9c comp_template_args(tree_node*, tree_node*, tree_node**, tree_node**)
$SRC/gcc/cp/pt.cc:9603
0x1eea34a spec_hasher::equal(spec_entry*, spec_entry*)
$SRC/gcc/cp/pt.cc:1698
0x1f87ad5 hash_table<spec_hasher, false,
xcallocator>::find_with_hash(spec_entry* const&, unsigned int)
$SRC/gcc/hash-table.h:999
0x1f862b5 hash_table<spec_hasher, false, xcallocator>::find(spec_entry* const&)
$SRC/gcc/hash-table.h:430
0x1f10502 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int)
$SRC/gcc/cp/pt.cc:10294
0x1f3443a tsubst(tree_node*, tree_node*, int, tree_node*)
$SRC/gcc/cp/pt.cc:16527
0x1f32952 tsubst_function_type
$SRC/gcc/cp/pt.cc:16132
0x1f3639f tsubst(tree_node*, tree_node*, int, tree_node*)
$SRC/gcc/cp/pt.cc:16988
0x1f59a33 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
$SRC/gcc/cp/pt.cc:23097
0x1b9b482 add_template_candidate_real
$SRC/gcc/cp/call.cc:3723
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.