https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125759
Bug ID: 125759
Summary: [reflection] ICE on reflection of reference pack
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: kengusername at proton dot me
Target Milestone: ---
This program fails to compile on gcc 17 trunk 20260611
https://godbolt.org/z/se3jKo5x9
```
consteval auto foo(auto&&... xs) { return (^^xs, ...); }
static_assert(foo(0));
```
compiler output:
```
<source>: In instantiation of 'consteval auto foo(auto:1&& ...) [with auto:1 =
{int}]':
<source>:2:18: required from here
2 | static_assert(foo(0));
| ~~~^~~
<source>:1:46: internal compiler error: in outer_var_p, at cp/semantics.cc:4551
1 | consteval auto foo(auto&&... xs) { return (^^xs, ...); }
| ^~
0x29f88b8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x29ed4fb internal_error(char const*, ...)
???:0
0xb34400 fancy_abort(char const*, int, char const*)
???:0
0xe2ab0c outer_automatic_var_p(tree_node*)
???:0
0xdfe84a get_reflection(unsigned long, tree_node*, reflect_kind)
???:0
0xdc9ae4 tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
???:0
0xdec85d instantiate_decl(tree_node*, bool, bool)
???:0
0xc53dd3 maybe_instantiate_decl(tree_node*)
???:0
0xc55de7 mark_used(tree_node*, int)
???:0
0xb6d217 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
???:0
0xe29b55 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
???:0
0xd880f3 c_parse_file()
???:0
0xf17d19 c_common_parse_file()
???:0
/cefs/0a/0a807b6a24c8fee700fe27d1_gcc-trunk-20260611/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1plus
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/0a/0a807b6a24c8fee700fe27d1_gcc-trunk-20260611/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
-D_GNU_SOURCE <source> -quiet -dumpdir /app/ -dumpbase output.cpp -dumpbase-ext
.cpp -masm=intel -mtune=generic -march=x86-64 -g -std=c++26
-fdiagnostics-color=always -fno-verbose-asm -freflection -o /app/output.s
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.
```