https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120314
Bug ID: 120314
Summary: internal compiler error: tree check: expected tree
that contains 'decl minimal' structure, have
'error_mark' in decl_internal_context_p, at
cp/tree.cc:3866 only in trunk and 15.1 with -std=c++23
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mario.rodriguezb1 at um dot es
Target Milestone: ---
ICEs on:
```
#include <iostream>
template <class T>
struct std::integral_constant
{
};
```
Stack dump
```
/opt/compiler-explorer/gcc-trunk-20250516/include/c++/16.0.0/type_traits:94:28:
internal compiler error: tree check: expected tree that contains 'decl minimal'
structure, have 'error_mark' in decl_internal_context_p, at cp/tree.cc:3866
94 | static constexpr _Tp value = __v;
| ^~~~~
0x2943295 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x2961006 internal_error(char const*, ...)
???:0
0x9e1c59 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
???:0
0xd34cf4 tsubst(tree_node*, tree_node*, int, tree_node*)
???:0
0xd60449 instantiate_class_template(tree_node*)
???:0
0xd5179d instantiate_template(tree_node*, tree_node*, int)
???:0
0xd521e7 lookup_and_finish_template_variable(tree_node*, tree_node*, int)
???:0
0xd46b1b tsubst_tree_list(tree_node*, tree_node*, int, tree_node*)
???:0
0xd2797d instantiate_decl(tree_node*, bool, bool)
???:0
0xd61f72 instantiate_pending_templates(int)
???:0
0xbe65e1 c_parse_final_cleanups()
???:0
0xe5fa08 c_common_parse_file()
???:0
```
To reproduce:
https://godbolt.org/z/GxeKs7zzM