[Bug c++/115852] New: gcc crashed in diagnostic_context::diagnostic_impl when using a explicit object lambda inside requires clause
rungecc at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jul 10 01:54:39 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115852
Bug ID: 115852
Summary: gcc crashed in diagnostic_context::diagnostic_impl
when using a explicit object lambda inside requires
clause
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rungecc at gmail dot com
Target Milestone: ---
Reproducer (see online compiler https://godbolt.org/z/Wafce5v1Y):
```
// g++ -std=c++26 main.cpp
template<class...Ts0>
auto x(Ts0&&... ) requires requires {
[]<class Self>(this Self&&) {
};
} {
return 0;
}
int main() {
return x(1);
}
```
Stacktrace:
```
<source>: In substitution of 'template<class ... Ts0> auto x(Ts0&& ...)
requires requires{<lambda>;} [with Ts0 = {int}]':
<source>:11:13: required from here
11 | return x(1);
| ~^~~
<source>:3:5: internal compiler error: in satisfy_declaration_constraints, at
cp/constraint.cc:3290
3 | []<class Self>(this Self&&) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 |
|
5 | };
| ~
0x26e53e5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t)
???:0
0x26f2f92 internal_error(char const*, ...)
???:0
0xa671ce fancy_abort(char const*, int, char const*)
???:0
0xaeca58 constraints_satisfied_p(tree_node*, tree_node*)
???:0
0xb68589 mark_used(tree_node*, int)
???:0
0xb691b0 mark_single_function(tree_node*, int)
???:0
0xb97f27 maybe_add_lambda_conv_op(tree_node*)
???:0
0xcc69ec tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
???:0
0xaeb076 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
???:0
0xaeca58 constraints_satisfied_p(tree_node*, tree_node*)
???:0
0xcce6e3 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
???:0
0xa96599 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
???:0
0xcef6ce finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
???:0
0xc71afa c_parse_file()
???:0
0xdc86d9 c_common_parse_file()
???:0
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.
Compiler returned: 1
```
More information about the Gcc-bugs
mailing list