<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/152282>152282</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[DebugInfo] Unexpanded parameter pack variables have misleading debug-info
</td>
</tr>
<tr>
<th>Labels</th>
<td>
lldb,
debuginfo
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Michael137
</td>
</tr>
</table>
<pre>
Was looking at what the debug-info looks like for https://github.com/llvm/llvm-project/pull/121417.
Take this modified example from p1061r10:
```
struct C { int x = 1, y = 2, z = 3; };
template <class T>
void now_i_know_my() {
auto [a, b, c] = C();
auto [d, ...e] = C();
auto [...f, g] = C();
auto [h, i, j, ...k] = C();
__builtin_debugtrap();
}
int main() {
now_i_know_my<int>();
return 0;
}
```
```
clang++ pack.cpp -g
```
Then in LLDB:
```
$ lldb a.out -o run -o v
(lldb) v
(int) a = 1
(int) b = 2
(int) c = 3
(int) d = 1
(int) e = 2
(int) f = 1
(int) g = 3
(int) h = 1
(int) i = 2
(int) j = 3
```
Note how the unexpanded parameter packs (e.g., `e`, `f`) are represented are showing as `int`s instead of packs.
Here's a dwarfdump snippet
```
0x00000058: DW_TAG_variable
DW_AT_location (DW_OP_fbreg -16, DW_OP_plus_uconst 0x8)
DW_AT_name ("c")
DW_AT_type (0x00000000000000e7 "int")
0x00000065: DW_TAG_variable
DW_AT_location (DW_OP_breg31 WSP+32)
DW_AT_name ("d")
DW_AT_type (0x00000000000000e7 "int")
0x00000070: DW_TAG_variable
DW_AT_location (DW_OP_breg31 WSP+32, DW_OP_plus_uconst 0x4)
DW_AT_name ("e")
DW_AT_type (0x00000000000000e7 "int")
```
Symptoms look similar to what happens with template parameter packs https://github.com/llvm/llvm-project/issues/24643
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0Vt1u6zYMfhrlhqghyz9JLnyR1Ms24Gw7wOnQS0O2aVuNLBmSnLR7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