https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127121
--- Comment #2 from 沈育霖 <danny321974345 at gmail dot com> ---
I think the change in C++26 is due to the newly introduced erroneous value.
The equivalent C++26 code would therefore be:
struct S {
S() {}
int a[5];
};
void foo(int*);
int callee([[indeterminate]] S s) {
foo(s.a);
return s.a[0];
}
int caller() {
return callee(S{});
}
int local() {
[[indeterminate]] S s{};
foo(s.a);
return s.a[0];
}
However, the two cases are still treated differently:
callee(S{}) emits zero-initialization of s.a
local() does not