@Chris-Kawa said in Conditional operator as a statement:
I doubt it will actually affect code gen much (but I've been wrong before, so we'll see).
Starting with C++26 [[indeterminate]] will be the old (current) behavior. Without it we are in the area of the newly defined "erroneous behavior". What this means in this context is that a variable without the [[indeterminate]] attribute (and without initialization) will be initialized starting from C++26, at least before it is first read from (if the first read happens before the first write). Depending on how much the compiler can prove initialization might always happen ("always" for a lazy compiler). I agree that in most cases the most common compilers will generate the same code. (Everything else will be a bug in the original code.)