<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/93141>93141</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[LLDB] Duplicated FieldDecl
</td>
</tr>
<tr>
<th>Labels</th>
<td>
lldb
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
asavonic
</td>
</tr>
</table>
<pre>
I stumbled across a bug where a FieldDecl is duplicated in a C++ record. The decl name and type are identical, but addresses are different. LLDB and Clang don't account for this, and Clang crashes during layout computation later. I don't have a short reproducer for this issue yet. LLDB seems to crash only when there is a certain sequence of separate expression evaluations.
However, there used to be a patch [D102993](https://reviews.llvm.org/D102993) that fixed a similar issue, but it was reverted in [D113449](https://reviews.llvm.org/D113449). The original test seems to be valid, but it was disabled in the revert, and it still is:
```
lldb/test/API/lang/cpp/reference-to-outer-type/TestCppReferenceToOuterClass.py:
class TestCase(TestBase):
@unittest.expectedFailure # The fix for this was reverted due to llvm.org/PR52257
def test(self):
self.build()
self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
test_var = self.expect_expr("test_var", result_type="In")
nested_member = test_var.GetChildMemberWithName("NestedClassMember")
self.assertEqual("Outer::NestedClass", nested_member.GetType().GetName())
```
@rupprecht, @Teemperor, do you know what happened with D102993 after the revert? Can you confirm that the test from the patch is indeed valid?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVV2P4rgS_TXmpdQROKGBBx4auLm3pbmzo1FL-9iq2BXiXSfO2GVo_v3KDh_d87QIQWJX1Tk-9WEMwRwHoq1Y7sTyMMPInfNbDHhyg1GzxunL9hUCx76xpAGVdyEAQhOPcO7IEyDUhqw-kLJgAug4WqOQSYMZAGEv5E7IHXhSzusC3joCnWwH7Alw0MCXkQA9gdE0sFFohdxDExlQa08hUMjb2rQteRq4gG_fDrvsu7c4HEG7QcgVAyrl4sDQOg_cmZDiPKyUx9BRYujNcASLFx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