> There's just no reason to do it because C++11 and C++20 are forwards and backwards compatible, so you might as well compile everything with C++20 if you're already going to compile it all from source.
This isn't exactly true. The programming language version is one dimension of the problem, but there are a few other dimensions. For instance, some projects enable/disable features based on the language version, and that leads to unexpected errors. I recall that Boost caused a bunch of problems when upgrading a compiler version on a old legacy project just because the subproject enabled constexpr on C++11 which caused obscure linker errors out of nowhere.
There is far more to language version upgrades, and even compiler version upgrades, than flipping a switch.
Yep, that’s right. I would include that in the same exception that I listed, where libraries can choose to reflect on the language version that they are compiled with and expose different behavior that can cause issues.
I should mention that the pedantic reason why I have experience with this is that it is usually okay to compile and link with distribution-provided binary packages (where you don’t control the language version) as long as you use the distribution-provided toolchain, and upgrading the language version that you use for your code won’t cause any issues unless one of your dependencies is doing this kind of reflection. Some Linux distros will provide separate versions of packages for each language version in order to solve the problem for libraries like abseil and boost.
This isn't exactly true. The programming language version is one dimension of the problem, but there are a few other dimensions. For instance, some projects enable/disable features based on the language version, and that leads to unexpected errors. I recall that Boost caused a bunch of problems when upgrading a compiler version on a old legacy project just because the subproject enabled constexpr on C++11 which caused obscure linker errors out of nowhere.
There is far more to language version upgrades, and even compiler version upgrades, than flipping a switch.