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

    <tr>
        <th>Summary</th>
        <td>
            [analyzer] Copy-constructor should trigger a load
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:static analyzer
      </td>
    </tr>

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

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

<pre>
    Recently I was investigating a new diagnostic caused by #72107 ([analyzer] Switch to PostStmt callbacks in ArrayBoundV2).

Eventually drilled down to [this](https://godbolt.org/z/bfeMvWrnn):
```c++
class Obj {};
void top() {
  Obj buf[10];
  Obj copy(buf[404]); // No issue with ArrayBound, but ArrayBoundV2 reports this
 (void)copy;
}
```

I was wondering if there is something wrong with `check::Location` given that we now report this with the `PostStmt<ArraySubscriptExpr>` callback.
It turns out that the copy-constructor takes the parameter by reference - no surprise. Consequently, there is no lvalue to rvalue conversion (aka. we don't have a read operation). However, one could argue that a copy-constructor should really do a load of the argument passed, thus begs the question:
Shouldn't we force model a "load" for copy-constructor, move-constructor, copy-assignment, move-assignment?

Any opinions?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VN1u4zgPfRrlhmhgS0kcX-QiaRt8A3z7gy2wey3LjK2pInok2t7M0y8kt910BgsYTiDSh-eQ1NEx2s4jHsT2JLZPKz1yT-EQGfVrr92qofZ2-AMNenY3-AKzjmD9hJFtp9n6DjR4nKG1uvMU2RoweozYQnMDIVUly6ICIfdie9Jeu9t3DGL7BC-zZdMDE_xOkV_4ymC0c402r6kAHEPQtxONvv1TClmvRfEkiuPyfp7Q86idu0EbrHPYQkuzT2Bie-LeRrF9EnLfMw9RqKOQZyHPHbUNOV5T6IQ8fxfy3Fzwl-mv4L2QdUpbSuyK5TFCntKTT43TMcJvzVcQ1UlUT0K9BSayLTANSaGsczSfQ05uxovYnso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