Since this is very likely to be by design forever, I think you can skip filing a bug.
STL
From: degski
Interestingly [or maybe not so interestingly] MSVC (15.8/7) is the only compiler available there [on godbolt] that does NOT produce more optimal code for the signed integer case (at any optimization level) (STL are you listening).
I am listening, but I am not a compiler backend dev. :-) I'll give the guys in the garden shed a shout [**hollering**]. I recommend filing a bug about the missed optimization opportunity through the C++ tab of Developer Community at https://developercommunity.visualstudio.com/spaces/62/index.htmlhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevelopercommunity.visualstudio.com%2Fspaces%2F62%2Findex.html&data=02%7C01%7Cstl%40exchange.microsoft.com%7Cbe16b2ff5c1840eef80c08d655dcb523%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636790803755931797&sdata=XGFh3Was%2FA0sEzMysPq%2FUMTpnjy6RoQ%2BIePzPNDrVX4%3D&reserved=0 . Well, it's UB, so anything can happen, so, is it a bug? It surely misses an opportunity [one compiler just returns 1 on the first function and does absolutely nothing else]. Wrapping signed int's doesn't make much sense [and mixes hardware with software, but hey, that'll go away with C++20]. I'm sympathetic to the effort [of turning it [the UB] into something that at some level does make sense]. The problem in my view is that [exactly what you've said below] people depend on it and therefore start writing non-portable code, without even knowing it. That I think is bad. Is there a warning? I bet you clang-cl will make a mess of the code that works so well with MSVC. Please confirm that you still want me to file a bug, iff yes, I'll do so. degski -- “If something cannot go on forever, it will stop" - Herbert Stein