https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128934
Bug ID: 128934
Summary: ICE in build_source_location_impl, at
cp/cp-gimplify.cc
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: s.kimura.h41104 at gmail dot com
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/4qnvr7K18
Reproducer:
```
namespace std {
struct source_location {
struct __impl {
void foo(int p) pre(p > 0) {}
};
};
} // namespace std
```
Backtrace:
<source>: In member function 'void std::source_location::__impl::foo(int)':
<source>:4:33: error: 'std::source_location::__impl' does not contain only
non-static data members '_M_file_name', '_M_function_name', '_M_line' and
'_M_column'
4 | void foo(int p) pre(p > 0) {}
| ^
<source>:4:33: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have error_mark in build_source_location_impl,
at cp/cp-gimplify.cc:4410
0x2d38ce8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x2d2d92b internal_error(char const*, ...)
???:0
0xac8fa6 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
???:0
0xcf0eaf build_contract_check(tree_node*)
???:0
0x1a635c3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
???:0
0xcd57e8 cp_genericize(tree_node*)
???:0
0xd31a07 finish_function(bool)
???:0
0xe81783 c_parse_file()
???:0
0x1018359 c_common_parse_file()
???:0