<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95207>95207</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang++ arm64] std::move error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
peter5232
</td>
</tr>
</table>
<pre>
My clang enironment is as below.
```
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```
And I write code for learning `std::move`.
```lang=cpp
#include <iostream>
#include <string>
#include <vector>
int main(){
std::string str = "Hello";
std::vector<std::string> v;
v.push_back(str);
std::cout << "After copy, str is \"" << str << "\"\n";
v.push_back(std::move(str));
std::cout << "After move, str is \"" << str << "\"\n";
std::cout << "The contents of the vector are \"" << v[0]
<< "\", \"" << v[1] << "\"\n";
}
```
The output is,
```
After copy, str is "Hello"
After move, str is "Hello"
The contents of the vector are "Hello", "Hello"
```
But `std::move` shoule move `str`. The right output is,
```
After copy, str is "Hello"
After move, str is ""
The contents of the vector are "Hello", "Hello"
```
I don't know why.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VU2PozgQ_TXFxWpkyiEhBw4JTLR92Fsf9rZyoBK8Y2xkm2T6368MyaQ3zWq0WrUUEeH3quq5PijpvTobohLyPeR1IsfQWVcOFMjlKDA52va9_P2dNVqaMyOjnDU9mcCUZ9KzI2l7TYHXwHew5rff9Pom3ZkCiB2Trl-vXuQwaHpppbsqgyLN0zuvcyRb1tuWdGQP1qsfM_RqfJBaU1srFyHAw24YtGpkUNZ4wMMfjW0plcMAeKisCWRCPK7pQtoO5AAPb9bqppPqwa_pJEcd0h9NuGOAh9FH9lGZxdvMz51p2Su7OhWIRU_sZB3TJJ1R5sxgzX1oQexA7Hp7IVjz59TELIKom2G4ASiUafTYEgNRKeuDI9mD-LYE--BUNF8EL9QE6x7g9FQmsH66XgG4hc1-PmY_Zc4umQ-OgagZIP5GWltABHEnM_bg36NUTx5AfGOXh8klHUbf_XmUzXfAwgcXoy86bOwYonwQVYy-OwVyrLHDO2A1yVKeQV5FQYh34iz3bnOD88o8y36W8bE2P2X9J2Wz6f9X9m9R3rrYWHMfM3tioSM255xJR5_jXSDfc8jrm-dPobFatskgr38p9CH39r6plye9I2bHMIzxqwBYLZKWK_uh3z6wnrP8zPpVlj7wsfpsvjja-1iHzwPMfGdHTZOkGXdxrFmU4NS5C1998y-99CtrrQHcBPbd2Cu7du9p0pai3YqtTKjMNlmRFYicJ125WRUik3K9KlpRbI-bExciKwpBxwzllheJKpHjiq8z5EXOOU9PLRVynVHWnIg4b2HFqZdKp1pf-tS6c6K8H6nc5sg3iZZH0n5aRIjTuplask5cGfkvx_HsYcW18sE_PAQV9LS9bhZ7wP28cGKH_6OajJyzLhmdLrsQBh8RPAAezip04zFtbA94iJ5vfy-Ds39REwAPk9C4QGatlxL_DgAA__-m3gwy">