<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123369>123369</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Offset of captures-by-copy is not observable
</td>
</tr>
<tr>
<th>Labels</th>
<td>
c++,
clang:frontend,
rejects-valid,
lambda
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Endilll
</td>
</tr>
</table>
<pre>
Consider the following example, courtesy of @erichkeane (https://godbolt.org/z/Tz7arYjvn):
```cpp
int x;
auto lam = [x](auto lam2){ return offsetof(decltype(lam2), x); };
return lam(lam);
```
This is arguably well-formed, because `x` refers to unnamed non-static data member of the lambda per https://eel.is/c++draft/expr.prim.lambda#capture-6.1.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxcUkuPozwQ_DXNxQJBO0By4JDHl-t3mcse_WiCZ42NbJNJ5tevnGR2dldCQu5HdXVVixjNxREN0B6gPRViTZMPw39OG2ttIb2-D0fvotEUWJqIjd5a_2HchdFNzIslwCNTfg2J4p35kcGmpmDU9JOEIwa4nVJaIvA94BnwfPFaepsqHy6A50_A89tnL8KP96sD3OWyeg9d_fzUskC9Ny6xG_AD1HuxJs-smBnwE4P2cIP2BLj9CmOG6A8sUFqDY34cIyU_Am41KZvuCwFuv-rwyG6PkQcG_emJ_2q0Yn4WPvN_UoJ6_zaZyExkIlxWIe2dfZC15ejDTDqjSlJijcSgq2_Q1SzQSCGy5NnqnJhJM-ddGZNIRjEtkmAzzZJCVi9LbMUstWALBfa3dkS2MhHwrAAPgAcdxJhy_LaEaglmrp6tgFyJJa2Byq5qqkIPXO_4ThQ0ND3vG4683xTT0G5JdFxpJXvRIqquGduNlrwWrawbEoUZsMa2bpq-6TZdwyvqcFR8M8qacOw2XTZ7FsZW1l7n7GlhYlxpaJDzbldYIcnGx20hvkgDIuAxv61wF-D7MXiXyOnfiUDvpFIsr8Ka7-jXapjPNAx5YCnXS4RNbU1M8ZtCMsnS8P_D_KzpS4tYynup_HLP3jmfmJeRwlVIS8Ua7PDPnZo0rbJSfgY8Z-jXr1yCz_QAz49Vsx2vba8D_goAAP__aSsKaw">