<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/91186>91186</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLDB typedefs are too lazy
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
labath
</td>
</tr>
</table>
<pre>
```
$ cat /tmp/a.cc
struct X {
typedef int InX;
};
X a;
X::InX b;
int main() {
return b;
}
$ g++ /tmp/a.cc -g -o /tmp/a.out
$ bin/lldb /tmp/a.out
(lldb) target create "/tmp/a.out"
Current executable set to '/tmp/a.out' (x86_64).
(lldb) expr -- X::InX a; a
error: <user expression 0>:1:4: no member named 'InX' in 'X'
1 | X::InX a; a
| ~~~^
(lldb) expr b
(X::InX) $0 = 0
(lldb) expr -- X::InX a; a
(X::InX) $1 = 0
```
This happens because lldb does not construct the clang ast type (only lldb_private::Type) when parsing the dwarf. The clang ast is contructed only when something references the lldb_private::Type -- which can sometimes be too late. Also see #90958 for another issue with lazy typedef parsing (however, unlike this issue, I know how to work around the other one).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVM1uqzoQfhpnMwrChgRYsEiaE6nSWXaR3ZExA_jW2Mg2pTmLPvuVnaRpe9vFlSJCxvP9-BvH3DnZa8SabPZkc1jx2Q_G1oo33A-rxrTnmmzT6yc9kHRHWA6CeyDs6MeJsCNPhLgsOW9n4eEEpNhfKuDPE7bYgdQeHvWJZNcFUhzu7_F5Av5eOZFsR7Ldoz5B86UtEI1casJKwqoPShb9bPXH_uJwd9wTtids_9k1rHtYm481M_s7pgkqR6Xa5oeWMqwFF57bHj0Ii9wjEMa-9DN2gTzM1qL2gK8oZs8bheDQgw8eiq-YAggrX8vtn21OWJX8RxRfJwvrNXwIKyQI_NKJ1hpLsh2Q7GF2aGM_OieNhpRkv0i2oyTb5aFFGxhxbNCC5iO2wU0YFitA6vAjvF5jBgAKpHj4STauvb29kc2v7x037-U7Q5wky1Mg2QHS_7vT76joJ6ovJzg-nwbpYODThNpBg4LPDiEOuzXoQBsPwujrkfYDglBc98Cdj4c6DMdodY6QP5OVL9zjxcXTecJgYxlQw8Stk7qPDO3CbZfA0ycy6YJOlMEWImUEOjOiHwLUYocWtUAXWb4XDPksgxQDCH4FyxHDzsAbA4p7TGCnnAGHwXxWpdWmhM5Y4Nr4AS1I52aERfoBFP97fv_v3rZAWDmYBV_QEvYAs1byGcGHGCMyFB_hWZsFBrOEQ70Y-wzcmlm30flFxuiQTrJq66ytsoqvsKYFzasqz2i6GmrebDveNYzSpu3otuQ041SwgnVCsA67laxZyvJ0k24ppSXLE97xDulGZFnR0W2bkTzFkUuVKPUyJsb2q2iwrigttyvFG1QuXniMaVxu7lm4_2wdMOtm7h3JUyWdd3cWL73C-vfvw_6WjQNubwH_Pa9mq-rB-8mFubAjYcde-mFuEmHGeJW83L7WkzX_oPCEHaO8I-wY7f0bAAD__z2Gqbk">