You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell, this is well defined and should not issue a warning. Foo is an aggregate and initialization expressions in a list initializer are sequenced. Neither GCC nor MSVC warn on this construct. Clang itself does not warn on other similar forms of this, such as:
struct Foo
{
int x;
int y;
};
int main()
{
Foo f = {
.x = {},
.y = f.x + 1,
};
return f.y;
}