<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/69922>69922</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang static analysis assert in CXXInstanceCall::getCXXThisVal
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          AndrewScheidecker
      </td>
    </tr>
</table>

<pre>
    While working with a build of clang that has assertions enabled, I found a simple repro for an assertion failure with tip of tree clang (e558be51bab051d1471d92e967f8a2aecc13567a to be precise):
https://github.com/llvm/llvm-project/blob/9330261143ccbe947ef0687fd20747ba47f26879/clang/lib/StaticAnalyzer/Core/CallEvent.cpp#L722

At the point where the assertion is triggered, `ThisVal.dump()` prints:
```
(reg_$1<long long Element{SymRegion{reg_$0<class a * this>},0 S64b,class a}.i>) & 1
```

Repro command-line:
```
clang -cc1 -analyze -analyzer-checker=core -x c++ repro.cpp
```

Contents of `repro.cpp`:
```
class a {
 void b();
  long long i;
  void d() { __builtin_bit_cast(a *, i & 1)->b(); }
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2PpDYQ_TXuS6lbpgADBw79MS2tlNNOlMxtZJsCnHXbyDYzmfz6COiZziEbKRLY2JSrnl_VKxmjGRxRy8oTKy87OafRh_boukDvz3ok05H-QWGnfPfR_j4aS_Duww_jBng3aQQJaja2A9-DttINkEaZYJQRZIwUkvEuAjmpLHUMz_ANej-7DiREc5ssQaApeOh9AOkeZ6CXxs6BtiDJTEuAFIjuURjWVJa1ojJTUvEy67KiyroGqRFVX0uUpHWWl6KSkDwogimQNpEYNiw_Mn5h_DimNMVlhVeG18GkcVYH7W8Mr9a-fU77Kfg_SCeGV2W9Ynht8pyjyLIi11pRU1TUc1FXfYe8Kioli6pHUVcNw-uKdnFkloPPSSajj07aj78oMLyefaBlktY-vZFLBz1NDPNfKsQN4jYeE6SRYPLGJXgfKdC6frBlIqRghoHCxjIT_NfRxN-kPXTzbWJYL_cWHKZgXIpfDDDB78-2xDrQ8MqwyFh-tt4NsA5Plm7kEqtOzx-37zQY71h1uptylp-1lTGCBIZHSKOJLH9i1YXhmcOzKBTDTwtWXQ5m-YsNMBSQ_TuOdfy-Vob2t5t03d4aRz_DvdXEXusM9nJj9-sj7PW4ljDLL9oHgv2foBmeGJ622ls5_zmKs3eJXIpLATLBH0cE_w84GxvVaduAN286UPc05J-78GDY_GN3Ne4248UHvL4uGkvGvSqTXrWMiWG9kr3k2tyJxGbP8qdHEFgysMGrLl_uv6DuujbvmryRO2oz0dRcFGVW7saWlOwxL7ioei14n2e6LwXPqG6UqHVT70yLHPNseTEvuTjwQhadaoh6qXtNPSs43aSxh0U-Bx-GnYlxplY0DeLOSkU2rg0H8a4PXHpPaFe5qXmIrODWxBQfHpJJltrzmui4ygjWBEfz2WnAODi_vHxzMUmnadHUkqD8OFA6v7zc9bCbg23_t_BX_JHhdb3C3wEAAP__262R6g">