https://github.com/ibob/msvc-const-move-bug
MSVC moves a const variable and takes its contents as if it is not const
https://github.com/ibob/msvc-const-move-bug
Last synced: over 1 year ago
JSON representation
MSVC moves a const variable and takes its contents as if it is not const
- Host: GitHub
- URL: https://github.com/ibob/msvc-const-move-bug
- Owner: iboB
- Created: 2021-09-28T04:52:41.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-31T08:06:19.000Z (almost 4 years ago)
- Last Synced: 2025-02-14T14:55:57.571Z (over 1 year ago)
- Language: C++
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MSVC const move bug
MSVC can be made to move a const variable and take its contents as if it is not const with no errors or even warnings whatsoever.
A demo and CI which showcase the bug are included in this repo.
## Notes
This is only reproducible with `/permissive` which is the default if `/permissive-` is not specified. For example for projects generated by CMake.
Specifying `/permissive-` (which is the default for projects generated by Visual Studio) works as expected and doesn't display the bug.
The open issue on Microsoft Developer Community is [here](https://developercommunity.visualstudio.com/t/a-const-variable-can-be-moved-losing-its-contents/1540939)