My program changed its behavior after updating Visual Studio to the latest version (2026).
Simplifying it, I got the following minimal example, which contains a ternary operator with a throw in inactive branch:
constexpr int x = [] { struct { int vs[3]; } a{}; auto && v = (true ? a : throw 0).vs[0]; v = 1; return a.vs[0]; }(); // x = 1 in VS2022 v17.13 // x = 0 in VS2022 v17.14.14 and VS2026 v18.0.0 In Visual Studio 2022 v17.13, x evaluated to 1. But in the latest Visual Studios: both 2022 v17.14.14 and the recently released Visual Studio 2026 v18.0.0, x already evaluates to 0. Online demo.
Which result is correct here if the program is well formed?